You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Peter Veentjer - Anchor Men <p....@anchormen.nl> on 2005/04/16 19:24:27 UTC

finding all docs with field.

How can I find all documents with a field (the value doesn`t matter).
 
I have tried:
Query query = new TermQuery(new Term(AbstractBaseDoc.FIELD_INDEX_ERROR,""));
  
 
But this never finds results. The field with name FIELD_INDEX_ERROR has been of type Unindex, Text, Keyword  but it doesn`t matter. 
 
I have checked the index with Luke, and I did find a document with the specified field.. So there are documents.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: finding all docs with field.

Posted by Gusenbauer Stefan <gu...@eduhi.at>.
Peter Veentjer - Anchor Men wrote:

>How can I find all documents with a field (the value doesn`t matter).
> 
>I have tried:
>Query query = new TermQuery(new Term(AbstractBaseDoc.FIELD_INDEX_ERROR,""));
>  
> 
>But this never finds results. The field with name FIELD_INDEX_ERROR has been of type Unindex, Text, Keyword  but it doesn`t matter. 
> 
>I have checked the index with Luke, and I did find a document with the specified field.. So there are documents.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
>  
>
What content does this field have?
I use the following:
To every Document I add Field.Keyword("all","all"); (The values and the
name doesn't matter)
When I search for them i made the following Query  query = new
TermQuery(new Term("all","all")); This should return all the fields.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org