lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <...@digimem.net>
Subject Re: Getting an exact field match
Date Thu, 03 Jul 2003 08:41:32 GMT
Add Location as Keyword and delete something like this:

 Term t = new Term("LOCATION", location);
 indexReader.delete(t);



--
Ian.
ian@digimem.net


> Reece.Wilton@dig.com ("Wilton, Reece") wrote 
>
> 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
> 
> 
----------------------------------------------------------------------
Searchable personal storage and archiving from http://www.digimem.net/


Mime
View raw message