lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven A Rowe <sar...@syr.edu>
Subject RE: Hierarchical Fields
Date Wed, 15 Sep 2010 17:03:18 GMT
Summarizing a #lucene conversation I had with Iam (aka PackageLost):

-----
Steve: How deep is your hierarchy? I ask because you may be able to have one field for each
level in the hierarchy, and boost the levels higher the closer they are to the root

Iam: Hum, now is ... 5-7.  I think 6

Steve: If you have fields "level1", "level2", "level3", etc., and boost level1 highest, level2
a little lower, etc., then search against all levels

Iam: But can a document have different fields? There are all fields and plus those N levels
fields but some documents just need 2 levels.

Steve: Lucene does not require every document to have the same set of fields. doc1 could have
field "A", and nothing else, and doc2 could have field "B" and nothing else, both in the same
index. No problem.
-----

An example: Iam's third query from below ("pop") could be expanded to the following QueryParser
query (assuming just one "content" field in addition to the "levelX" fields):

content:pop level1:pop^128 level2:pop^64 level3:pop^32 level4:pop^16 level5:pop^8 level6:pop^4
level7:pop^2

This would result in doc4, doc5, doc2, which is the desired behavior.

Steve


(12:30:14 PM) sarowe: 
> -----Original Message-----
> From: Iam Jabour [mailto:iamjabour@gmail.com]
> Sent: Wednesday, September 15, 2010 12:22 PM
> To: java-user@lucene.apache.org
> Subject: Re: Hierarchical Fields
> 
> Let's go to some example:
> 
> 1 - Suppose I have some path tree, like:
> - /music/
>   | - rock/
>     | - doc1 = "artist1 music blues ..."
>     | - doc2 = "artist2 music pop ..."
>   | - blues/
>     | - doc3 = "artist3  ..."
>     | - pop/
>         - doc5 = "artist1 ... "
>   | - pop/
>     | -  doc4 = "artist1 music rock ..."
> 
> 2 - I created lucene documents like this example:
>  field1 = ("path", doc1fullpath)
>  field2 = ("value", doc1Value)
> and do the same to all documents.
> 
> 3 - now I going to do the search:
>   $ rock
> I get some sort like: [doc4, doc1, doc2]
> but I want: [doc1 | doc2] and the others [doc3 & doc4] like doc1, doc2,
> doc4
> 
>   $ music AND blues
> I get: doc1, doc3
> but I want: doc3, doc1
> 
>   $ pop
> I want: doc4 then doc5 (because the path to doc4 is smaller then doc5)
> 
> So to do this I need:
> 1 - change field boost
> 2 - set priority of path, and to do that: I create N field (one field
> to node in the path) or have some Lucene feature (but I don't know
> how)
> 
> Thanks.
> ______________
> Iam Jabour
> 
> 
> 
> 
> On Wed, Sep 15, 2010 at 12:52 PM, Steven A Rowe <sarowe@syr.edu> wrote:
> > Hi Iam,
> >
> > Can you say why you don't like the proposed solution?
> >
> > Also, the example of the scoring you're looking for doesn't appear to be
> hierarchical in nature - can you give illustrate the relationship between
> the tokens in [token1, token2, token3]?  Also, why do you want token1 to
> contribute more to the score than token2?
> >
> > Steve
> >
> >> -----Original Message-----
> >> From: Iam Jabour [mailto:iamjabour@gmail.com]
> >> Sent: Wednesday, September 15, 2010 9:20 AM
> >> To: lucene-group
> >> Subject: Hierarchical Fields
> >>
> >>  Hello, any one can help me with fields?
> >>
> >> I have the same problem posted in
> >>
> http://search.lucidimagination.com/search/out?u=http://wiki.apache.org/luc
> >> ene-java/HierarchicalFields,
> >> but I don't like the proposed solutions. I need a order field, like [
> >> token1, token2, token3]
> >> If a query match with token1 the score is bigger then a match in
> >> token2, or same thing like that.
> >>
> >> ______________
> >> Iam Jabour
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> 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