Hi Steve,
Why can't you use a different field for each of the Level_X's, i.e.
MyLevel1Field, MyLevel2Field, MyLevel3Field?
Well, the hierarchical structure needs to be maintained. As hundreds of
Level_X entities can be found on levels 2 and 3, I need to be able to
tell for instance which Level_3 entities belong to which common Level_2
entity. Throwing all Level_3 entities in a field of their own would
remove this information, as far as I can see.
I was also thinking about adding Payloads at some point, but the main
caveat here is that the Payload data cannot be tested for equality at
search time. E.g. if I have a term T1 and add a payload that states this
term belongs to Level_3:200;Level_2:65;Level_1:44 and I have a term T2
with Level_3:200;Level_2:66;Level_1:44 I cannot state at search time
that I would like the number for Level_2 entities to be the same. I
could say Level_2 has to be 65, but I don't now that beforehand of
course. Or am I overlooking something here?
On 03/15/2010 at 9:59 AM, Rene Hackl-Sommer wrote:
Search in MyField: Terms T1 and T2 on Level_2 and T3,
T4, and T5 on Level_3, which should both be in the
same Level_1.
I don't understand what you mean by "which should both be in the same Level_1".
Can you give more details?
I guess my initial pseudo-XML construct might have been misleading, my
apologies. To be more precise, it is like this:
<!ELEMENT MyField (Level_1+) >
<!ELEMENT Level_1 (Level_2+) >
<!ELEMENT Level_2 (Level_3+) >
<!ELEMENT Level_3 (Terms+) >
<!ELEMENT Terms (#PCDATA) >
What I am adding to Lucene is a single Field MyField. I preprocess the
input string so that it looks like "Term1 Term2 endOfLevel_3 Term3 Term4
endOfLevel_3 Term4 Term5 endOfLevel_3 endOfLevel_2 Term8 Term9
endOfLevel_3 ...". Note the appearance of Level_2.
I use a custom Filter to switch the position increment as needed and as
indicated by the marker tokens. The marker tokens themselves don't get
indexed.
Cheers
Rene
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org