lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilton, Reece" <Reece.Wil...@dig.com>
Subject Getting an exact field match
Date Wed, 02 Jul 2003 18:44:36 GMT
Hi,

I am indexing XML files.  The XML files have a Location element.  For
example, the Location is /Foo/Bar.html in one of the files.

When I update the index, I want to remove the existing document.  I
search for the Location and delete the existing document like this:

Query query = QueryParser.parse(location, "LOCATION", new
StandardAnalyzer());
Hits hits = searcher.search(query);
for (int i = 0; i < hits.length(); i++) {
	indexReader.delete(hits.id(i));
}

But I never get anything returned from the searcher.  I'm passing in the
exact value that is in the field.  How do I get an exact match of the
field?  Should I be adding Location as Text or Keyword?  I've tried both
but can't get it to return what I want.

Is the problem because I have slashes ("/") in the field?  Does the
StandardAnalyzer filter those out or something?

Any help is appreciated!
Reece

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


Mime
View raw message