Hi,
I am currently working on retrieving url and contentLength of each
document
found during the search. I want to retrieve it during the calculation of
score so that I can influence the score in some other way.
I am trying to retrieve the url and use it as filter. The main problem is
I
don't want to use a reader to continuously retrieve the url for each
document located.
TermDocs termDocs = reader.termDocs();
TermEnum termEnum = reader.terms (new Term (field, ""));
do{
Term term = termEnum.term();
}while(termEnum.next());
I am using this code to retrieve the field containing the url but it is
tokenized. Is there anyway to untokenized it or is there a better way to
do
this?
Also, I try to retrieve the contentLength, but the results return are
null.
Why is that? I opened the index using Luke and the contentLength is there
but when I try to get it using this way, the results is null.
Can anyone help me with both of these problems? Any help will be
appreciated. Thanks