Hi,

I try to search numbers with a certain deviation. My parser is ExtendedDisMax.
A possible search expression could be 'twist drill 1.23 mm'. It will not match 
any documents, because the document contains the keywords 'twist drill', '1.2' 
and 'mm'.

In order to reach my goal, I've indexed all numbers as points with the 
solr.SpatialRecursivePrefixTreeFieldType.
For example '1.2' as <field name="feature_nr">1.2 0.0</field>.
A search with 'drill mm' and a filter query 'fq={!geofilt pt=0,1.23 
sfield=feature_nr d=5}' delivers the expected results.

Now I have two problems:
1. How can I get ExtendedDisMax, to 'replace' the value 1.2 with the 
'{!geofilt}' function?
  My first attemts were

- Build a field type in schema.xml and replace the field content with a regular 
expression
'... replacement="_query_:&quot;{!geofilt pt=0,$1 sfield=feature_nr 
d=5}&quot;"'.
The idea was to use a nested query. But edismax searches 
'feature_nr:_query_:"{!geofilt pt=0,$1 sfield=feature_nr d=5}"'.
No documents are found.

- Program a new parser that analyzes the query terms, finds all numbers and 
does the geospatial stuff. Added this parser in the 'appends' section of the 
'requestHandler' definition. But I can get this parser only to filter my 
results, not to extend them.

2. I want to calculate the distance (d) of the '{!geofilt}' function relative 
to the value, for example 1%.

Could there be a simple solution? 

Thank you in advance.
Holger

Reply via email to