The code snippet you posted is implementation of MatchAllQuery , it only
gives you the live doc id in the specified segment. If you want to get
extra information about a term, eg. freq, payload, you need to do some
calculation. The good thing is FST is sorted, so you can maintain a list of
TermsEnu
Hi,
> I don't find an elegant solution. reader.termDocs(null) returns AllTermDocs
> which doesn't exist in lucene 4.3.
>
>
> I use this piece of code
>
> Bits liveDocs = reader.getLiveDocs();
> for (int i = 0; i < reader.maxDoc(); ++i) {
> if (liveDocs != null && !liveDocs.get(i)
I don't find an elegant solution. reader.termDocs(null) returns
AllTermDocs which doesn't exist in lucene 4.3.
I use this piece of code
Bits liveDocs = reader.getLiveDocs();
for (int i = 0; i < reader.maxDoc(); ++i) {
if (liveDocs != null && !liveDocs.get(i)) {
continue;
There's a fair chunk of info on TermDocs and friends in the migration
guide. http://lucene.apache.org/core/4_3_1/MIGRATE.html
Does that cover your question?
--
Ian.
On Mon, Jul 8, 2013 at 12:32 PM, Yonghui Zhao wrote:
> Hi,
>
> What's proper replacement of "TermDocs termDocs = reader.termDocs
On May 12, 2010, at 7:42 PM, roy-lucene-u...@xemaps.com wrote:
> Hi guys,
>
> I've had this code for some time but am just now questioning if it works.
>
> I have a custom filter that i've been using since Lucene 1.4 to Lucene 2.2.0
> and it essentially builds up a BitSet like so:
>
> for ( i
It's interesting that you found this speedup... I'm not sure offhand
what changes led to the speedup (but I'm still happy about it!).
But... why do you need to iterate through all terms, and all docs for
each term, in the first place?
EG this is what FieldCache does in order to populate v
It seems like you are trying to use the TermDocs iterator to load the
term freq for that particular document (doc)?
It doesn't work that way -- instead, it simply iterates over all
documents that this term occurred in. (Ie it will replace the doc in
the int[] that you passed in, with the
:
: >termDocs = reader.termDocs(term);
: >while(termDocs.next()){
: >int index = termDocs.doc();
: >if(reader.document(index).get("id").equals(id)){
: >reader.deleteDocument(index);
: >}
: >}
:
I'm sorry, the problem was with the way the id was being indexed. It was
marked as tokenized, so I when searched for it's untokenized form I was not
getting the doc, now everything works fine :)
Regards
On Sat, Jun 21, 2008 at 2:08 PM, Karl Wettin <[EMAIL PROTECTED]> wrote:
>
> 20 jun 2008 kl. 1
20 jun 2008 kl. 18.12 skrev Vinicius Carvalho:
Hello there! I trying to query for a specific document on a
efficient way.
Hi Vinicius,
termDocs = reader.termDocs(term);
while(termDocs.next()){
int index = termDocs.doc();
if(reader.docume
A couple of questions:
1> I assume by "not returning any docs" you mean that you
never get into your while loop. Is that true?
2> I'm a little suspicious of the field labeled "id" and whether
it's at all possible that this is getting confused with the
internal Lucene doc ID. This is a
11 matches
Mail list logo