Neetz
Neetz

Reputation: 364

solr doesn't search in all fields

I have indexed my table and able to search in q parameter like

q=field:*

q=field:parameter

q=*:* ( displays all results )

But When I give query like this

q=*:parameter

I get

undefined field *

How do I search in all fields and use the same query ( i.e q=*:parma ) and make it work ?

here's my schema.xml

<field name="id" type="int" indexed="true" stored="true"/>

<field name="enrol_no" type="text" indexed="true" stored="true"/>
<field name="name" type="text" indexed="true" stored="true"/>
<field name="addr" type="text" indexed="true" stored="true"/>
<field name="phno" type="text" indexed="true" stored="true"/>
<field name="email_id" type="text" indexed="true" stored="true"/>
<field name="spec" type="text" indexed="true" stored="true"/>
<field name="state" type="text" indexed="true" stored="true"/>
<field name="dob" type="text" indexed="true" stored="true"/>
<field name="gender" type="text" indexed="true" stored="true"/>
<field name="placeofpractice" type="text" indexed="true" stored="true"/>
<!--Changes end / -->
<field name="all" type="text" indexed="true" stored="true" multiValued="true"/>
<copyField source="*" dest="all"/>

Upvotes: 1

Views: 246

Answers (1)

Jayendra
Jayendra

Reputation: 52779

Solr doesn't allow * in the fields search as a replacement for all fields.
There is JIRA SOLR-4493 but no plans to fix it as well.
You would need to copy the fields you want to search on to a single field with the copyfield directive and search on that field.

Also copyfield with source * is not yet supported.
JIRA SOLR-4729 is not yet released, but you can try the patch.

You have to add individual fields or use a single field for all incoming fields.

Upvotes: 2

Related Questions