tags:

views:

368

answers:

2

In lucene.net can we search for a content without giving field name..and it will search in all fields that are indexed.

+1  A: 

It will search all fields which are specified in the schema as searched by default.

Kevin Peterson
Can you please provide me code snippet,syntax..for how you will write query for the same.
lucene user
+2  A: 

Use MultiFieldQueryParser to parse your queries, and provide it with a array of the field names you want searched.

The query doesn't need any special syntax. If your query is "cat hat" it will search all the specified fields for either of these terms. If your default operator is AND, it will require that each term be found in at least one field.

KenE