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: Searching repeating fields
Date Thu, 22 Jun 2006 19:38:02 GMT

: Here, the 'revenue-info' is a repeating node, so we can have records like :
: Record 1
: ---financial-data
: ------revenue-info
: --------year = 2000
: --------amount = 1000000
: ------revenue-info
: --------year = 2001
: --------amount = 2000000
:
: Record 2
: ---financial-data
: ------revenue-info
: --------year = 2000
: --------amount = 2000000

: Has someone encountered something similar ? Can it be implemented any
: other way ?

depending on how many financial data blocks you'll have in a given
"record" you can enumerate them in field names, and then search on all of
the possible enumerarations...

Doc#1...
field_revenue-info_1_year = 2000
field_revenue-info_1_amount = 1000000
field_revenue-info_2_year = 2001
field_revenue-info_2_amount = 2000000

Doc#2...
field_revenue-info_1_year = 2000
field_revenue-info_1_amount = 2000000

Query...
  ((+field_revenue-info_1_year:2000 +field_revenue-info_1_amount:[2000000 TO *])
   (+field_revenue-info_2_year:2000 +field_revenue-info_2_amount:[2000000 TO *]))


...but this approach is really only feasible when there is a limited
number of times these "sets' of fields will be repeated, and you know what
the upper bound is at query time.


-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