Query EP

The Query EP allows developers to change the weights of the query according to certain fields and it allows for the complete re-writing of the query.

Usage

  1. Implement Sando.ExtensionContracts.QueryContracts.IQueryRewriter.RewriteQuery
  2. Implement Sando.ExtensionContracts.QueryContracts.IQueryWeightsSupplier.GetQueryWeightsValues
  3. Add query rewriter to Sando's configuration file (link to come)

API

Interface Sando.ExtensionContracts.QueryContracts.IQueryRewriter
Method string RewriteQuery(string query) - Rewrite the query according to any scheme
Interface Sando.ExtensionContracts.QueryContracts.IQueryWeightsSupplier
Method Dictionary<string, float> GetQueryWeightsValues - Provide mapping between field name and query weight

Default implementation

  • Does not re-write the query
  • Weighs the "name" field a '4' and all other fields a '1'
For details see: QueryWeightsSupplier.cs

Example Scenario

A user could implement this extension to rewrite the query by adding synonyms or to increase the weight of method bodies (i.e., the 'body' field) to equal the 'name' field.

References

  • N/A

Last edited Jun 19, 2012 at 8:59 PM by davidcshepherd, version 4

Comments

No comments yet.