hymm -- that *should* not be the case. The id field in
QueryElevationComponent uses the globally defined field:
SchemaField sf = core.getSchema().getUniqueKeyField();
...
idField = sf.getName().intern();
The only thing that may be weird is that if you id field is named
"myid", your elevate.xml file still refers to "id" as the unique key.
Is that what you are refering to?
I have not tested this, so it may very well be broken.
ryan
On Nov 22, 2008, at 5:31 PM, Paolo Ruscitti wrote:
I have a question about QueryElevationComponent.
I'm trying to use it but it seems it works properly if, and only if,
the id
field name in <uniqueKey> definition is '*id*'.
so if I have <uniqueKey>*myid*</uniqueKey>, it does not work.
Could you please tell me what I'm doing wrong?
thaks a lot
Paolo
- this is my elevate.xml
<elevate>
<query text="cars">
<doc id="77b81d932353a5d16880043bdb4fe22b"/>
</query>
</elevate>
- I added at the tail of solrconfig.xml file
...
<!-- a search component that enables you to configure the top
results for
a given query regardless of the normal lucene scoring.-->
<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>
<!-- a request handler utilizing 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>
</config>
- in my schema I have
<field name="md" type="string" indexed="true" stored="true"
required="true"
/>
...
<uniqueKey>myid</uniqueKey>