lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ykin...@xs4all.nl>
Subject Re: Term
Date Wed, 27 Mar 2002 19:30:46 GMT
Aruna,

> Hi,
> While adding documents using something like the following-
> document.add(Field.Text("object number", m_strObjectNumber));
> I used a string "object number" as you can see. I can not find the 
> values for "object number" when I do a search. I am using a
> StandardAnalyzer. Any idea why this is happening?

You would need to pose a query like this

object number:54321

However this is parsed by the standard analyzer  as a query looking
for the term 'object' in the default field and looking
for the term '54321' in the field named 'number'.

There are three workarounds:
- change your fieldname to eg. objectnumber, and query by:
  objectnumber:54321
- use 'object number' as the default field for searching.
- construct the query without using the standard analyzer.

I think the best solution would be to change the fieldname
into something shorter like 'onr' which allows for easy querying.


Regards,
Ype



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


Mime
View raw message