lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Harwood <markharw...@yahoo.co.uk>
Subject Re: Searching docs with multi-value fields
Date Fri, 09 Jul 2010 14:30:24 GMT
Check out lucene 2454 and accompanying slide show if your reason for doing this is modelling
repeating elements. 
----------------------------------------


On 9 Jul 2010, at 13:43, "Hans-Gunther Birken" <hgbirken@t-online.de> wrote:

> I'm examining the following search problem. Consider a document with two
> multi-value fields.
> 
> 
> 
> Document doc = new Document();
> 
> 
> 
> doc.add(new Field("f1", "a1", Field.Store.YES, Field.Index.ANALYZED));
> doc.add(new Field("f1", "a2", Field.Store.YES, Field.Index.ANALYZED));
> doc.add(new Field("f1", "a3", Field.Store.YES, Field.Index.ANALYZED));
> 
> 
> 
> doc.add(new Field("f2", "b1", Field.Store.YES, Field.Index.ANALYZED));
> doc.add(new Field("f2", "b2", Field.Store.YES, Field.Index.ANALYZED));
> doc.add(new Field("f2", "b3", Field.Store.YES, Field.Index.ANALYZED));
> 
> 
> 
> The following search expression is applied:
> 
> f1:ax AND f2:by
> 
> where x, y  is 1,2, or 3.
> 
> 
> 
> Thus  the search condition f1:a2 AND f2:b2 should return the above document
> whereas  the  condition  f1:a1  AND f2:b2 should return no result. Thus the
> search  should  return  the  document if and only if the conditions of each
> field are satisfied at the same "index" level.
> 
> 
> 
> Does anyone have an idea how to solve this problem using Lucene/Java?
> 
> 
> 
> Thanks
> 
> HGB
> 
> 
> 

---------------------------------------------------------------------
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