python - django / haystack / solr simple config - partial field matching issue -


On my demo app I have a simple configuration of a haystack / sulter:

From this app:

  class device (models.Model): ... hostname = model.carfield (max_length = 45, help_text = "hostname for this device") ... < / Code> 

From this app's search_sites.py:

  class devIndex (indexes.SearchIndex): '' 'Hesmac Class,' 'Text = Index' CRField (Document = True, Use_Stemlet = True)  

Templates / Search / Index / System_management / Device_text for this app. By text (all job names)

  ... {{object.hostname}} ...  

Problem:

The name of a system is static1.foo.com:

If I search for "stable" then I get results for all static servers ("static" in their description field)

If I search for "stable 1", then I get 0 results

If I search for "static1.foo.com" then I get results

My question is, "statistic 1" does not match query Why does the Haystack / Solr?

This is probably an analysis problem. I think that you can get this field in your schema.xml file Using standard tuner.

The standard tokeniser makes the host names token in the form of a token. (Ref :), so you can only match it with the whole hostname.

If you want to search by piece, you will need to use a different tokenizer. In the Solar example, the default text field uses the whitespaceconoconcer and the word delimiter filter, which will split the host name. This will allow you to search with the 'Static 1' query.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -