lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Lucene Query ... understanding
Date Thu, 16 Feb 2006 18:30:42 GMT

: Am just trying to see if i understand the lucene query below correctly.
:
: +(+contentNew:radio +contentNew:mp3) +entity:product +(name:radio
: mp3^4.0 (contentNew:radio contentNew:mp3) contentNew:radio mp3^2.0)
:
: Let me see if can understand the above query correctly:

your interpretation isn't quite right -- you are assuming
phrases in cases where there aren't any.  just because there is no field
name in front of a word, doesn't mean that word is a continuation of a
phrase from the previously mentioned field -- it is a term query on
whatever the default field for the index is.

think of your query as expressing...

  REQUIRED:
     REQUIRED: contentNew:radio    w/score boost of 1.0
     REQUIRED: contentNew:mp3      w/score boost of 1.0
  REQUIRED: entitiy:product        w/score boost of 1.0
  REQUIRED:
     SHOULD: name:radio            w/score boost of 1.0
     SHOULD: defaultField:mp3      w/score boost of 4.0
     SHOULD:
        SHOULD: contentNew:radio   w/score boost of 1.0
        SHOULD: contentNew:mp3     w/score boost of 1.0
     SHOULD: contentNew:radio      w/score boost of 1.0
     SHOULD: defaultField:mp3      w/score boost of 2.0

if you want to ignore the scores, and just talk about what documents will
match, then it's simplified representation is ...

   contentNew:radio AND contentNew:mp3 AND entitiy:product AND
   (name:radio OR defaultField:mp3)

: (I am trying to understand the above query in terms of ANDs, ORs,
: Groupings and boosting as opposed to prohibited and required)

I would strongely recommend you embrace the idea of
prohibited/required/optional, it's a much more general way to think
about queries.  Any query can be expressed in terms of nested
groupings of require, prohibited, and optional clauses -- But it's not
always possible to take a query and express it in simple AND/OR/NOT
boolean logic (which is one of the reasons why i had the fact that the
class is called "BooleanQuery")

Consider this query:      foo:cat +bar:dog

...the closest boolean logic representation of this query that exists is:

	bar:dog

ie, the only documents that contain the term bar:dog match -- but that
doesn't allow you to express the impacts of the foo:cat clause will have
on the scores of the documents.




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message