0

I've indexed two Mysql tables in a SolR core and I'm currently trying to launch requests from the backend (administration panel provided by SolR).

Problem : When I type nothing in "q" parameter, Solr gives back all the results it has in its index. But when I type a word (that exists in many of the fields indexed in the same typography) Solr doesn't give back anything.

More infos : Here's an example of the query URL when searching for rue:

http://127.0.0.1:8983/solr/core_test/select?q=rue&wt=json&indent=true

And when searchin with an empty 'q' value :

http://127.0.0.1:8983/solr/core_test/select?q=*%3A*&wt=json&indent=true

I've indexed the field in the <fields> tag like this :

<field name="ts_variable1" type="text" indexed="true" stored="true"/>

<field name="ts_variable2" type="text" indexed="true" stored="true"/>

<field name="ts_variable3" type="text" indexed="true" stored="true"/>

I've used a data-import handler for mysql. (solr-dataimporthandler-.*.jar) (sorry I don't remember what the wildcard is for). and configured it like :

<requestHandler name="/dataimport"  class="solr.DataImportHandler">
  <lst name="defaults">
    <str name="config">data-config.xml</str>
  </lst>
</requestHandler>
Ismail H
  • 4,226
  • 2
  • 38
  • 61
  • 1
    You are using `string` field, it's no tokenized, and need to be matched exactly. If you are not searching by exact match, then change your field type to `text`, refer: http://stackoverflow.com/questions/7175619/apache-solr-string-or-text – Eric Feb 17 '16 at 14:48
  • thanks for the usefull information. I just tried with "text" but it doesn't seem to work either.I updated the question – Ismail H Feb 17 '16 at 15:00
  • Can you post your query url? – Eric Feb 17 '16 at 15:02
  • I just posted the url. http://127.0.0.1:8983/solr/core_test/select?q=rue&wt=json&indent=true – Ismail H Feb 17 '16 at 15:09
  • You are using standard parser, which need to specify field name together with value, e.g `http://127.0.0.1:8983/solr/core_test/select?q=ts_variable1:rue&wt=json&indent=true` , refer: https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser – Eric Feb 17 '16 at 15:13
  • Do you know how i can search on all string and text field together ? I have like a thousand fields to search on ... – Ismail H Feb 17 '16 at 15:16
  • That's kind wield to have so many fields, but refer: http://stackoverflow.com/questions/8089947/solr-and-query-over-multiple-fields, Or, you can use `edismax` parser, and use `qf` param to specify a list of fields to query on. – Eric Feb 17 '16 at 15:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/103745/discussion-between-ismah-and-eric-wang). – Ismail H Feb 17 '16 at 15:23

0 Answers0