lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: AND Queries
Date Mon, 29 Jul 2013 12:07:25 GMT
qf with multiple fields triggers what is known as a dismax or DisjunctionMax 
query. It matches a document if ANY of the listed fields contains the query 
term - checking each term one at a time. So, if you search for three terms 
with three different fields in qf, the terms may occur in different fields, 
so that they won't necessarily all appear together in any individual field.

Give us an example document that you think is not being matched properly.

Best to try it and reproduce it with the Solr example, if possible.

And, most importantly, best to start every query by writing it in clear, 
concise, and complete English - it can be a lot easier to debug a query if 
we know what the original intent is.

-- Jack Krupansky

-----Original Message----- 
From: Furkan KAMACI
Sent: Monday, July 29, 2013 6:01 AM
To: solr-user@lucene.apache.org ; fbrisbart@bestofmedia.com
Subject: Re: AND Queries

When I send that query:

select?pf=url^10+title^8&fl=url,content,title&start=0&q=lang:en+AND+(cat+AND+dog+AND+pencil)&qf=content^5+url^8.0+title^6&wt=xml&debugQuery=on

It is debugged as:

+(+lang:en +(+(content:cat^5.0 | title:cat^6.0 | url:cat^8.0)
+(content:dog^5.0 | title:dog^6.0 | url:dog^8.0) +(content:pencil^5.0 |
title:pencil^6.0 | url:pencil^8.0))) (url:"cat dog pencil"^10.0)
(title:"(cat dog pencil)"^8.0)

Why default field is not applied at this situation?



2013/7/29 fbrisbart <fbrisbart@bestofmedia.com>

> It's because when you don't specify any field, it's the default field
> which is used.
>
> So,
> lang:en AND url:book AND pencil AND cat
>
> is interpreted as :
> ang:en AND url:book AND <default_field>:pencil AND <default_field>:cat
>
>
> The default search field is defined in your schema.xml file
> (defaultSearchField)
>
>
> Franck Brisbart
>
> Le lundi 29 juillet 2013 à 12:06 +0300, Furkan KAMACI a écrit :
> > I am searching for a keyword as like that:
> >
> > lang:en AND url:book pencil cat
> >
> > It returns me results however none of them includes both book, pencil 
> > and
> > cat keywords. How should I rewrite my query?
> >
> > I tried this:
> >
> > lang:en AND url:(book AND pencil AND cat)
> >
> > and looks like OK. However this not:
> >
> >
> > lang:en AND url:book AND pencil AND cat
> >
> > why?
>
>
> 


Mime
View raw message