Alternatives for opening Index

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Alternatives for opening Index


  I am currently working on retrieving url and contentLength of each
  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
  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, ""));
   Term term = termEnum.term();

  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

  Also, I try to retrieve the contentLength, but the results return are
  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