Bick
Bick

Reputation: 18551

Solr - Seeing far less results than expected

I have uploaded 80000 lines with random text to Solr using requestHandler from DB.

Looking in the core overview I see that the lines were updated enter image description here

In the schema I defined all the string columns as in the following example

...
<field name="packageName" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
...

I query using

http://localhost:8983/solr/vault/select/?q=everyone&fl=*

and I get no result though I know captain exists (cause I query

SELECT * FROM [dbo].[Fact] where packageNAme like '%everyone%'

) infact, only the following query

http://localhost:8983/solr/vault/select/?q=*&fl=id

returns rows

Why dont I get rows using the first query?
Thanks.

EDIT
Following this tutorial I was using this queries

http://localhost:8983/solr/products/select?q=aluminum  
http://localhost:8983/solr/collection1/select/?indent=on&q=video&fl=name,id

And it returned all the answers.

Upvotes: 0

Views: 133

Answers (1)

JHS
JHS

Reputation: 7871

Firstly everyone is no keyword in Solr. According to your query everyone looks like a keyword.

Secondly - When you query the database you have % in front and behind for the matching. You have to do the same in case of the Solr query.

Try this - http://localhost:8983/solr/vault/select?q=packageName:*everyone*. This will get you the result same as the DB.

Explanation - In the query i sent you, you would be trying to match the field packageName with everyone having 0 or more characters before and/or after it.

For more information have a look here

Added information after edit in the question - The default schema.xml that comes with Solr has a field called name which is marked as the default search field, which means a q=<search phrase> will be matched against the name field. The tutorial that you are looking at is using the name field and hence they get the output.

Upvotes: 1

Related Questions