Uploaded image for project: 'Solr Search Provider'
  1. Solr Search Provider
  2. MGNLEESOLR-62

Searching in an undefined field results in an exception stack trace

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 3.0
    • 2.2
    • None
    • Sprint 7 (Kromeriz)
    • 2

      The Magnolia Solr implementation uses the default Solr query syntax which means that you can search in all defined fields.

      We notice however that when you search on an undefined field (in the Solr index) you get an ugly exception stack trace in the logs. E.g. searching in the undefined field 'body' (e.g. https://www.magnolia-cms.com/search.html?queryStr=body:solr) results in:

      2015-05-12 13:27:00,171 ERROR earchprovider.logic.model.FacetedSearchResultModel: Error occurred during perform search.
      org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: undefined field body
              at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:424)
              at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
              at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90)
              at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301)
              at info.magnolia.search.solrsearchprovider.logic.providers.FacetedSolrSearchProvider.removeOutdatedIndexes(FacetedSolrSearchProvider.java:443)
      

      It would be nice if these searches would not result in a stack trace because this can easily fill up our logs.

      PS: searching on a defined field like 'title' works well (e.g. https://www.magnolia-cms.com/search.html?queryStr=title:solr) however I would have expected that searching in the 'content' field as defined in the customised Solr schema.xml would give search results but it does not give any.. E.g:
      https://www.magnolia-cms.com/search.html?queryStr=content:solr

        Acceptance criteria

              mdivilek Milan Divilek
              edgar Edgar Vonk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 0.3h
                    0.3h