You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jörg Agatz <jo...@googlemail.com> on 2010/07/12 11:05:14 UTC

fq= "more then one" ?

Hallo,

i tryes to ceate a new Search for mails, and become a Problem..

If i search:
http://172.20.1.33:8983/solr/select/?q=*:*&start=0&fq=EMAIL_HEADER_FROM:test@mail.de

it works, i only get E-Mails from test@mail.de
But i need something like That:

http://172.20.1.33:8983/solr/select/?q=*:*&start=0&fq=EMAIL_HEADER_FROM:test@mail.de&fq=EMAIL_HEADER_TO:test@mail.de

But that, dosent work, it looks like, i can Only one parameter in FQ..

Maby you can help me.

King

Re: fq= "more then one" ?

Posted by Jörg Agatz <jo...@googlemail.com>.
OK...
Thanks..

It works if i try it direktly..
but in PHP it dosent:

*Warning*: file_get_contents(http://...@mail.de OR
EMAIL_HEADER_TO:test@mail.de <EM...@mail.de>)) [
function.file-get-contents<http://172.20.1.33/new/function.file-get-contents>]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in *
/var/www/new/msearchres.php* on line *32*


Code:

$url='
http://172.20.1.33:8983/solr/select?wt=phps&q='.urlencode($q).'&sort='.urlencode($sort).'%20'.$direction.'&fq=(EMAIL_HEADER_FROM:'.$wo.'
OR EMAIL_HEADER_TO:'.$wo.')';

if(isset($_GET['s'])) $url.="&start=".$_GET['s'];
$serializedResult = file_get_contents($url);
$results = unserialize($serializedResult);

Re: fq= "more then one" ?

Posted by Rebecca Watson <be...@gmail.com>.
oops - i thought you couldn't put more than one - ignore my answer then :)

On 12 July 2010 17:20, Rebecca Watson <be...@gmail.com> wrote:
> hi,
>
> you shouldn't have two fq parameters -- some solr params work like
> that, but fq doesn't
>
>> http://172.20.1.33:8983/solr/select/?q=*:*&start=0&fq=EMAIL_HEADER_FROM:test@mail.de&fq=EMAIL_HEADER_TO:test@mail.de
>
> you need to combine it into a single param i.e. try putting it as an
> "OR" or "AND" if you're using the standard request handler:
>
> fq=EMAIL_HEADER_FROM:test@mail.de%20OR%20EMAIL_HEADER_TO:test@mail.de
>
> or put something like + if you're using dismax (i think but i don't use it :) )
>
> hope that helps,
>
> bec :)
>

Re: fq= "more then one" ?

Posted by Rebecca Watson <be...@gmail.com>.
hi,

you shouldn't have two fq parameters -- some solr params work like
that, but fq doesn't

> http://172.20.1.33:8983/solr/select/?q=*:*&start=0&fq=EMAIL_HEADER_FROM:test@mail.de&fq=EMAIL_HEADER_TO:test@mail.de

you need to combine it into a single param i.e. try putting it as an
"OR" or "AND" if you're using the standard request handler:

fq=EMAIL_HEADER_FROM:test@mail.de%20OR%20EMAIL_HEADER_TO:test@mail.de

or put something like + if you're using dismax (i think but i don't use it :) )

hope that helps,

bec :)

Re: fq= "more then one" ?

Posted by rulinma <ru...@gmail.com>.
good.



--
View this message in context: http://lucene.472066.n3.nabble.com/fq-more-then-one-tp959849p4143943.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: fq= "more then one" ?

Posted by Chantal Ackermann <ch...@btelligent.de>.
Hi Jörg,

the filter queries are exclusive. You can specify as many as you want
but everything that does not fit one of them will be excluded from your
result.

You can specify an OR clause in a single filter query to achieve what
you want:

fq=(EMAIL_HEADER_FROM:test@mail.de OR EMAIL_HEADER_TO:test@mail.de)

Cheers,
Chantal

On Mon, 2010-07-12 at 11:05 +0200, Jörg Agatz wrote:
> Hallo,
> 
> i tryes to ceate a new Search for mails, and become a Problem..
> 
> If i search:
> http://172.20.1.33:8983/solr/select/?q=*:*&start=0&fq=EMAIL_HEADER_FROM:test@mail.de
> 
> it works, i only get E-Mails from test@mail.de
> But i need something like That:
> 
> http://172.20.1.33:8983/solr/select/?q=*:*&start=0&fq=EMAIL_HEADER_FROM:test@mail.de&fq=EMAIL_HEADER_TO:test@mail.de
> 
> But that, dosent work, it looks like, i can Only one parameter in FQ..
> 
> Maby you can help me.
> 
> King