Lucene search on specific field name?

Posted by Rachel on Stack Overflow See other posts from Stack Overflow or by Rachel
Published on 2010-06-08T13:21:02Z Indexed on 2010/06/08 13:32 UTC
Read the original article Hit count: 200

Filed under:
|

I have been playing around with an installation of SOLR that indexes some data from my database.

I am able to index data and query it back but I was wondering about how field name queries work.

For certain fields I am able to specify their name and the search text to have the results return as expected and for other fields, when I specify their name and search text, no results are returned.

q=type:book //(this will work)
q=type:book AND title:"The Title" //(no results returned)

In this example, type is a required field and title is not. For the example where I search by title, I can see the document in the results of the first query having the given title so I know that a document exists that matches this search.

Is making a field 'required' the only way to be able to search by field name?

[edit] I'm using the default installation and the 'example' folder inside of solr, editing the xml files and using the interface available through start.jar to be able to run, index and query.

© Stack Overflow or respective owner

Related posts about lucene

Related posts about solr