(11/11/11 4:15), Michael Herchel wrote:
I've searched high and low for this via Google and the Solr wiki page, and 
cannot find the answer.

My problem:
-----------

I'm having trouble getting the elevate.xml working. Here's what it currently 
looks like:

     <elevate>
       <query text="thanks giving">
       <doc id="9c3ec5/node/3564" />
      </query>
     </elevate>

From what I understand, this should work. According to 
http://wiki.apache.org/solr/SchemaXml#The_Unique_Key_Field, I need to have the 
unique key defined in the schema.xml. I checked this and I do have it:

     <uniqueKey>id</uniqueKey>

I found the "9c3ec5/node/3564" by doing a search directly off the Solr server 
(http://localhost:8983/solr/admin/) and finding the ID of the document that I wanted from 
the generated XML. Here is what the result of my search, so you can see where I got the 
ID from.

     <result name="response" numFound="2" start="0">
      <doc>
       <str name="body">
        --content here --
      </str>
       <date name="changed">2011-08-31T19:42:15Z</date>
       <int name="comment_count">0</int>
       <date name="created">2011-08-16T13:18:00Z</date>
       <str name="entity">node</str>
       <str name="hash">9c3ec5</str>
       <str name="id">9c3ec5/node/3564</str>

I have verified that elevate.xml is being loaded. When I start Solr manually 
(java -Dsolr.solr.home=c:/solr/ -jar start.jar), I do see the elevate.xml is 
being loaded:

INFO: Loading QueryElevation from: c:\solr\conf\elevate.xml Nov 10, 2011 
11:11:24 AM org.apache.solr.handler.component.SearchHandler inform INFO: Adding 
component:org.apache.solr.handler.component.QueryComponent@7bfbcffa

I also restart the Solr service after making any changes to elevate.xml. Is 
this enough? Do I need to reindex or do anything else?

Michael,

You need to check solrconfig.xml that you have QueryElevationComponent defined 
like this:

  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
    <!-- pick a fieldType to analyze queries -->
    <str name="queryFieldType">string</str>
    <str name="config-file">elevate.xml</str>
  </searchComponent>

Additionally, the search component (named "elevator" hare) should be defined in 
your
request handler:

  <!-- A request handler for demonstrating the elevator component -->
  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
    </lst>
    <arr name="last-components">
      <str>elevator</str>
    </arr>
  </requestHandler>

Finally, you need to use the request handler when you request:

http://localhost:8983/solr/elevate?q=thanks giving

And no, you do not need to reindex to get work QueryElevationComponent.

koji
--
Check out "Query Log Visualizer" for Apache Solr
http://www.rondhuit-demo.com/loganalyzer/loganalyzer.html
http://www.rondhuit.com/en/

Reply via email to