Re: posting list traversal code

2013-06-13 Thread Adrien Grand
On Thu, Jun 13, 2013 at 7:56 PM, Sriram Sankar wrote: > Thank you very much. I think I need to play a bit with the code before > asking more questions. Here is the context for my questions: > > I was at Facebook until recently and worked extensively on the Unicorn > search backend. Unicorn allo

Re: posting list traversal code

2013-06-13 Thread Sriram Sankar
Thank you very much. I think I need to play a bit with the code before asking more questions. Here is the context for my questions: I was at Facebook until recently and worked extensively on the Unicorn search backend. Unicorn allows documents to be ordered by a static rank in the posting lists

Re: posting list traversal code

2013-06-13 Thread Adrien Grand
Hi, On Thu, Jun 13, 2013 at 8:24 AM, Denis Bazhenov wrote: > Document id on the index level is offset of the document in the index. It can > change over time for the same document, for example when merging several > segments. They are also stored in order in posting lists. This allows fast > p

Re: posting list traversal code

2013-06-12 Thread Denis Bazhenov
Document id on the index level is offset of the document in the index. It can change over time for the same document, for example when merging several segments. They are also stored in order in posting lists. This allows fast posting list intersection. Some Lucene API's explicitly state that the

Re: posting list traversal code

2013-06-12 Thread Sriram Sankar
Thanks Denis. I've been looking at the code in more detail now. I'm interested in how the new SortingAtomicReader works. Suppose I build an index and sort the documents using my own sorting function - as shown in the docs: AtomicReader sortingReader = new SortingAtomicReader(reader, sorter); w

Re: posting list traversal code

2013-06-12 Thread Denis Bazhenov
I'm not quite sure, what you really need. But as far as I understand, you want to get all document id's for a given term. If so, the following code will work for you: Term term = new Term("fieldName", "fieldValue"); TermDocs termDocs = indexReader.termDocs(term); while (termDocs.next()) {