Introduced in Feature Pack 2

Analyzing Solr queries

You can analyze the parts of a Solr query to help understand the actions Solr takes when submitting a query.

About this task

In this task, the following query is analyzed:
  • http://host_name:port/solr/MC_11351_CatalogEntry_en_US/select?q=name:coffee

Procedure

  1. Analyzing the server part of the query: http://host_name:port/solr

    The host name of the search server, as defined in the WebSphere Commerce search configuration file (wc-search.xml) on the WebSphere Commerce EAR.

    The WebSphere Commerce search configuration file is stored in the following location:
    • WC_eardir/xml/config/com.ibm.commerce.catalog-fep/wc-search.xml

      The default WebSphere Commerce search configuration file.

    • WC_eardir/xml/config/com.ibm.commerce.catalog-ext/wc-search.xml

      The extended WebSphere Commerce search configuration file. This customized version of the file contains only the changed properties.

    The server configuration is stored in the Server section of the file, under BasicConfiguration or AdvancedConfiguration, depending on your deployment type.

    For more information about the server configurations within the file, see WebSphere Commerce search configuration file (wc-search.xml) (WC EAR).

  2. Analyzing the index part of the query: MC_11351_CatalogEntry_en_US

    The search index that the request maps to. A search server typically contains multiple indexes, with each master catalog containing its own group of indexes. The master catalog contains separate indexes for each language.

    There are three index types for each master catalog: CatalogEntry, CatalogGroup, and UnstructuredContent, and CatalogGroup, where the URL segment maps to:
    • MC_MasterCatalogID_indextype_language
    For example, if a master catalog (10001) contains two languages (en_US and fr_FR), there are six corresponding search indexes:
    1. MC_10001_CatalogEntry_en_US
    2. MC_10001_UnstructuredContent_en_US
    3. MC_10001_CatalogGroup_en_US
    4. MC_10001_CatalogEntry_fr_FR
    5. MC_10001_UnstructuredContent_fr_FR
    6. MC_10001_CatalogGroup_fr_FR

    The solrhome/solr.xml file contains the search index locations.

    For example:
    <cores adminPath="/admin/cores">
    <core instanceDir="MC_10001/en_US/CatalogEntry/" name="MC_10001_CatalogEntry_en_US"/>
    <core instanceDir="MC_10001/en_US/CatalogEntry/unstructured/" name="MC_10001_CatalogEntry_Unstructured_en_US"/>
    </cores>
    

    For more information about the search index and its types, see WebSphere Commerce search index schema.

  3. Analyzing the query details part of the query: select?q=name:coffee

    The query, specified as q, that is sent to Solr. In this case, all documents from an index are returned where the name field contains the value coffee.

    The results of the query are returned in XML format. If you are querying from a browser, it typically returns the first 10 documents. The following shows the response header, and the first document that is returned. Each doc tag contains a single document:
    
     <response>
    
    <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">1</int>
    <lst name="params">
    <str name="q">name:coffee</str>
    
    </lst>
    </lst>
    <result name="response" numFound="39" start="0">
    
    
    <doc>
    
    <int name="buyable">1</int>
    <arr name="catalog_id">
    <long>11351</long>
    <long>11401</long>
    </arr>
    <long name="catentry_id">13093</long>
    <str name="catenttype_id_ntk_cs">ProductBean </str>
    <str name="fullImage">
    images/catalog/kitchenware/kitchenware_160x160/KIES_01.jpg
    </str>
    <long name="member_id">7000000000000001751</long>
    <str name="mfName">AromaStar</str>
    <str name="mfName_ntk">AromaStar</str>
    <str name="mfName_ntk_cs">AromaStar</str>
    <str name="name">
    Coffee and Espresso Bar
    </str>
    <arr name="parentCatgroup_id_facet">
    <str>11351_11374</str>
    <str>11401_11503</str>
    </arr>
    <arr name="parentCatgroup_id_search">
    <str>11351_11374</str>
    </arr>
    <str name="partNumber_ntk">KIES-01</str>
    <float name="price_USD">499.95</float>
    <int name="published">1</int>
    <str name="sequence">000000000000000.00000</str>
    <str name="shortDescription">Brew coffee and espresso on demand.</str>
    <int name="storeent_id">11851</int>
    <str name="thumbnail">
    images/catalog/kitchenware/kitchenware_70x70/KIES_01.jpg
    </str>
    
    </doc>

    For more information about how to control what is returned in a search query, see Search services and interactions.