t*g 发帖数: 1758 | 1 如果我打开index,go through所有的term,然后要把每一个term所在的document里其
他所有的field打印出来,怎么做?谢谢!可以通过TermPostion和TermEnum直接得到吗? |
t*******e 发帖数: 684 | 2 It sounds to me you are taking a wrong programming approach. Why do you need to open an index file and go through all the search keys? |
t*g 发帖数: 1758 | 3 That's my director's idea. He thinks that'll be faster. Basically I'm
comparing two indices tokenized by two tokenizor.
But I think I found the way to implement it.
I take each Term can use TermDocs td = reader.termDocs(t) to get
TermDocs. Then int docNum=td.doc() to get a doc number. Is this doc number luceneid? Can I use this id to get the rest of
the fields?
need to open an index file and go through all the search keys?
【在 t*******e 的大作中提到】 : It sounds to me you are taking a wrong programming approach. Why do you need to open an index file and go through all the search keys?
|
t*g 发帖数: 1758 | 4 Or it might be easier for me just to run a search on the string of each term
to get Hits.
get
number luceneid? Can I use this id to get the rest of
【在 t*g 的大作中提到】 : That's my director's idea. He thinks that'll be faster. Basically I'm : comparing two indices tokenized by two tokenizor. : But I think I found the way to implement it. : I take each Term can use TermDocs td = reader.termDocs(t) to get : TermDocs. Then int docNum=td.doc() to get a doc number. Is this doc number luceneid? Can I use this id to get the rest of : the fields? : : need to open an index file and go through all the search keys?
|