1
votes

I had originally created in my solr schema 3 copy fields:

curl -X POST -H 'Content-type:application/json' --data-binary '{"add-copy-field": {"source":"company_name","dest":"_text_"}}' http://my-instance/solr/listing/schema
curl -X POST -H 'Content-type:application/json' --data-binary '{"add-copy-field": {"source":"address","dest":"_text_"}}' http://my-instance/solr/listing/schema
curl -X POST -H 'Content-type:application/json' --data-binary '{"add-copy-field": {"source":"city","dest":"_text_"}}' http://my-instance/solr/listing/schema

However, I have recently removed these from the schema and are now composing queries in a slightly different format. More advanced queries we have the need for edismax.

However, even by turning on edismax I'm receiving an error from the solr query parser as per below. Did I break something by deleting the copy fields?

/solr/listing/select?debugQuery=on&defType=edismax&q=%3A&stopwords=true

{
"responseHeader": {
"zkConnected": true,
"status": 400,
"QTime": 1,
"params": {
"q": "*:*",
"defType": "edismax",
"debugQuery": "on",
"stopwords": "true"
}
},
"error": {
"metadata": [
"error-class",
"org.apache.solr.common.SolrException",
"root-error-class",
"org.apache.solr.common.SolrException"
],
"msg": "org.apache.solr.search.SyntaxError: Query Field '_text_' is not a valid field name",
"code": 400
}
}

As per the comments the 'text' field remains in 3 places in the config:

"/update/extract":{
    "startup":"lazy",
    "name":"/update/extract",
    "class":"solr.extraction.ExtractingRequestHandler",
    "defaults":{
      "lowernames":"true",
      "fmap.content":"_text_"}}


"spellchecker":{
      "name":"default",
      "field":"_text_",


"initParams":[{
    "path":"/update/**,/query,/select,/tvrh,/elevate,/spell,/browse",
    "defaults":{"df":"_text_"}}]
1
Do you still have a default search field defined? Default Search Field & Query OperatorMatsLindh
Additionally - check the configuration for your request handlers in solrconfig.xml (or through the API). The configuration may have _text_ set as df or qf by default.MatsLindh

1 Answers

2
votes

As per the comment on my question (I'm still on the learning path of solr):

Although they have been deprecated for quite some time, Solr still has support for Schema based configuration of a <defaultSearchField/> (which is superseded by the df parameter) and <solrQueryParser defaultOperator="OR"/> (which is superseded by the q.op parameter.

If you have these options specified in your Schema, you are strongly encouraged to replace them with request parameters (or request parameter defaults) as support for them may be removed from future Solr release.

For our purposes and as we are using the edismax query parser we needed to specify the query fields that we wanted to use.