Source: http://blog.csdn.net/yangbutao/article/details/9450463
Search in the e-commerce platform is a very important feature, including the search for parts of speech navigation, automatic prompting and search sorting function
Automatically prompt as shown, you can automatically prompt according to the search term, and display the number of document in the list of recommended search terms
Class navigation as shown, such as searching for "milk" in the search box, displays the relevant class and the properties corresponding to the current class.
Here are a few examples of the above features to explain.
1. Search Sort
The complexity of the search function is the ranking of the document, and the scoring rule in Solr inherits the relevant scoring rules in Lucene, which supports complex scoring with SOLR's Dismax query parser.
At the time of grading, the following factors will be considered,
Search keyword matches Some fields are scored higher than other fields (qf^)
For some fields, the density of the search string (phrase) is the proportion of the score (pf^)
Other complex rule calculations, such as sales volume, price, seller level, etc., can be considered as factors affecting the scoring (BF)
http://10.1.1.58:8080/solr/select?deftype=dismax&qf=name^100 subject ^1 &q=sony mp3&pf=name^100 subject ^1&q.op=or&bf=sum (Recip (MS (now,last_modified), 3.16e-11,1,1), Div (1000,price)) ^100
The implication of this query is that search keywords in name and subject Sony Mp3,name and subject in field queries are 100, 1 (qf=name^100subject ^1) respectively, and the two fields phrase are divided into
pf=name^100 subject ^1, that is, name accounted for a larger proportion of the other also refer to the product price and product update time (Bf=sum (Recip (now,last_modified), 3.16e-11,1,1), Div ( 1000,price)) ^100)
2. Auto hint facet
http://10.1.1.58:8080/solr/select?q=*:* &rows=0&facet=true&facet.field=name_autocomplete& facet.prefix= TV
According to the TV word segmentation with the facets of automatic hints, the word is
3. Facet Classification Navigation
Users search in the search box, there will be classified navigation, category navigation is a tree structure, such as
All Categories > Milk powder/Complementary food/Nutrition > Milk Powder > Cow milk Powder
Categories can be property, for example, the properties of cow milk powder are ' brand ', ' applicable stage ', ' applicable age ', ' packaging method ', ' origin ', etc.
Users in the search box input ' milk ', search engine navigation to ' cow milk powder ' under this category, and automatically display the cow milk powder related properties, related implementation and algorithms have a lot, the following method can achieve this effect
Category navigation can refer to the first article of the search results, such as the highest score of the first document is the category of ' cow milk powder ', then the navigation display naturally navigate to this category, and the related properties are used in the category of bovine milk powder properties, such as ' brand ', ' applicable stage ', ' applicable age ', ' The corresponding relationship between the category and the attribute can be stored elsewhere.
The tree structure of classified navigation can be implemented by Facet.pivot
Http://localhost:8983/solr/select?q=name:stock&rows=0&facet=true&facet.pivot=category,category1, Category2,category3
The corresponding value of the category attribute, using the basic facet to achieve
Http://10.1.1.58:8080/solr/select?q=name: Milk &fq=category1: Powdered milk &fq=category2: Cow milk powder &rows=0& Facet=true&facet.field=logo&facet.field=property1&facet.field=property2& Facet.field=property3&facet.minc
A brief analysis of the use of SOLR in e-commerce platform