stefan schauer
stefan schauer

Reputation: 49

solr index empty although schema browser shows entries

I have a very strange problem: I am indexing documents without any problems.

When i go to the solr backend and search I get no results although in the schema browser I see that documents got indexed. Any idea what went wrong?

The hidden_b flag is set to false.

All helpful answers are appreciated.

Upvotes: 0

Views: 498

Answers (2)

Christian Lendel
Christian Lendel

Reputation: 420

It´s a problem with the configuration in your schema.xml. I suppose your default search field doesn´t contain any data. You have to copy the contents of the other fields to your default search field. Therefor I would suggest you to define a field just for searching the whole content. For example:

<field name="searchfield" type="mySearchField" indexed="true" stored="false" multiValued="true" />

after that, your change the default search field, in this case like that:

<defaultSearchField>searchfield</defaultSearchField>

The last thing you have to do is this:

<copyField source="anyfieldfromyours" dest="searchfield"/>

Make sure you defined the type I used for this example and that you copy all of your fields. If you have just a dynamic field, you just have to copy this field.

Best regards

Upvotes: 0

Samuele Mattiuzzo
Samuele Mattiuzzo

Reputation: 11048

/select/?q=*&version=2.2&start=0&rows=10&indent=on

this is your comment, but this actually doesn't work, the correct way to have all documents is this

/select/?q=*:*&version=2.2&start=0&rows=10&indent=on

notice the

*:*

instead of

*

as your q parameter. it means "search against any field for any value" (equivalent to SELECT * FROM TABLE in mysql)

using only a * brings you no results.

Upvotes: 1

Related Questions