Solr Operator
1, commonly used-
Q - query string, this is a must. If the query all *: *, according to the specified field query (Name: Drake and AND Address: Delhi)
Fq = CreateDate: [20170101 TO 20170131], find the keyword mm, and Create Date is the query, in the q query query results are fq query at the same time, for example: q = Name: 20170101
Fl - Specifies to return those field contents, separated by commas or spaces.
Start-return the first record in the complete search results in the offset position, 0 start, the general use of paging.
Rows - Specifies how many records to return to the results, with start to achieve paging.
Sort - sort, format: sort = + [, +] .... Example: (score desc, price asc) that the first "score" descending order, and then "price" ascending order, the default is the descending order of relevance.
Wt - (writer type) Specifies the output format, which can have xml, json, php, phps.
(Such as: Name, SKU, ShortDescription, or Name SKU ShortDescription [Note: the field is strictly case-sensitive]) if the query field is separated by a comma or a space Q.
op represents the logical operation of the condition of the query in q and AND (OR)
Hl is highlighted, such as hl = true
Hl.fl highlight field, hl.fl = Name, SKU
Hl.snippets: default is 1, here set to 3 fragments
Hl.simple.pre Highlight the previous format
Hl.simple.post highlights the format behind
Whether to start statistics
Facet.field statistics
[Note: The above is a more commonly used parameters, of course, the use of specific parameters or see Solr official technical documents]
Second, Solr operator
1. ":" specify the field to check the specified value, such as return all values ??*: *
2. "?" Indicates a wildcard for a single arbitrary character.
3. "*" indicates the wildcard of any number of characters (can not start using * or? Symbols in the retrieved item).
4. "~" that fuzzy search, such as the search spelling similar to the "roam" item to write: roam ~ will find the shape of the words such as foam and roams; roam ~ 0.8, retrieve return similarity in the record of 0.8 or more.
5. Neighborhood search, such as the search for 10 words separated by "apache" and "jakarta", "jakarta apache" ~ 10.
6. "^" control relevance search, such as the search jakarta apache, and want to let "jakarta" relevance is better, then add "^" symbol and incremental value, that is, jakarta ^ 4 apache.
7. Boolean operators AND, ||.
8. Boolean operators OR, &&.
9. Boolean operators NOT,!, - (exclude operators can not be used separately with the use of the query)
10. "+" exists operator, the required symbol "+" after the entry must be in the corresponding domain of the document.
11. () is used to construct sub queries.
12. [] contains a range of searches, such as retrieving a period of time records, including head and tail, date: [201609 TO 201612].
13. {} does not contain scope searches, such as retrieving a time period record, excluding head and tail
Date: {201609 TO 201612}.
14. / escape operator, special characters include + - && ||! () {} [] ^ "~ *:
Note: ? "+" and "-" that the modification of a single query unit, and, or, not is the intersection of two query units or do the difference or reverse the operation of the symbol
For example: AB: india + AB: america, that is AB: india ignore the dispensable, must meet the second condition is right, rather than what you think must meet the two search conditions
If the input: AB: india AND AB: america, the analytical results are two conditions at the same time to meet, that is, + AB: india AND + AB: america or + AB: india + AB: america
In short, the query syntax: modifier field name: query keyword AND / OR / NOT modifier field name: query keywords
Third, Solr query syntax
1. The most common query, such as query surnamed Drake (Name: Drake), if it is accurate search is equivalent to SQL SERVER in the LIKE search This requires quotation marks (""), such as inquiries containing Delhi(Address: Delhi").
2. Multi-conditional query, Note: If you can search for a single field can be used (Name: search conditions plus operator (OR, AND, NOT) Name: search conditions), such as fuzzy query (Name: ) Single field multi-condition search is not recommended to write, the general recommendation is in a single field for conditional screening, such as (Name: Drake OR), multiple field query (Name: Drake + Address: Delhi).
3. Sort, such as name asc (Name asc), descending (Name desc).
1, commonly used-
Q - query string, this is a must. If the query all *: *, according to the specified field query (Name: Drake and AND Address: Delhi)
Fq = CreateDate: [20170101 TO 20170131], find the keyword mm, and Create Date is the query, in the q query query results are fq query at the same time, for example: q = Name: 20170101
Fl - Specifies to return those field contents, separated by commas or spaces.
Start-return the first record in the complete search results in the offset position, 0 start, the general use of paging.
Rows - Specifies how many records to return to the results, with start to achieve paging.
Sort - sort, format: sort = + [, +] .... Example: (score desc, price asc) that the first "score" descending order, and then "price" ascending order, the default is the descending order of relevance.
Wt - (writer type) Specifies the output format, which can have xml, json, php, phps.
(Such as: Name, SKU, ShortDescription, or Name SKU ShortDescription [Note: the field is strictly case-sensitive]) if the query field is separated by a comma or a space Q.
op represents the logical operation of the condition of the query in q and AND (OR)
Hl is highlighted, such as hl = true
Hl.fl highlight field, hl.fl = Name, SKU
Hl.snippets: default is 1, here set to 3 fragments
Hl.simple.pre Highlight the previous format
Hl.simple.post highlights the format behind
Whether to start statistics
Facet.field statistics
[Note: The above is a more commonly used parameters, of course, the use of specific parameters or see Solr official technical documents]
Second, Solr operator
1. ":" specify the field to check the specified value, such as return all values ??*: *
2. "?" Indicates a wildcard for a single arbitrary character.
3. "*" indicates the wildcard of any number of characters (can not start using * or? Symbols in the retrieved item).
4. "~" that fuzzy search, such as the search spelling similar to the "roam" item to write: roam ~ will find the shape of the words such as foam and roams; roam ~ 0.8, retrieve return similarity in the record of 0.8 or more.
5. Neighborhood search, such as the search for 10 words separated by "apache" and "jakarta", "jakarta apache" ~ 10.
6. "^" control relevance search, such as the search jakarta apache, and want to let "jakarta" relevance is better, then add "^" symbol and incremental value, that is, jakarta ^ 4 apache.
7. Boolean operators AND, ||.
8. Boolean operators OR, &&.
9. Boolean operators NOT,!, - (exclude operators can not be used separately with the use of the query)
10. "+" exists operator, the required symbol "+" after the entry must be in the corresponding domain of the document.
11. () is used to construct sub queries.
12. [] contains a range of searches, such as retrieving a period of time records, including head and tail, date: [201609 TO 201612].
13. {} does not contain scope searches, such as retrieving a time period record, excluding head and tail
Date: {201609 TO 201612}.
14. / escape operator, special characters include + - && ||! () {} [] ^ "~ *:
Note: ? "+" and "-" that the modification of a single query unit, and, or, not is the intersection of two query units or do the difference or reverse the operation of the symbol
For example: AB: india + AB: america, that is AB: india ignore the dispensable, must meet the second condition is right, rather than what you think must meet the two search conditions
If the input: AB: india AND AB: america, the analytical results are two conditions at the same time to meet, that is, + AB: india AND + AB: america or + AB: india + AB: america
In short, the query syntax: modifier field name: query keyword AND / OR / NOT modifier field name: query keywords
Third, Solr query syntax
1. The most common query, such as query surnamed Drake (Name: Drake), if it is accurate search is equivalent to SQL SERVER in the LIKE search This requires quotation marks (""), such as inquiries containing Delhi(Address: Delhi").
2. Multi-conditional query, Note: If you can search for a single field can be used (Name: search conditions plus operator (OR, AND, NOT) Name: search conditions), such as fuzzy query (Name: ) Single field multi-condition search is not recommended to write, the general recommendation is in a single field for conditional screening, such as (Name: Drake OR), multiple field query (Name: Drake + Address: Delhi).
3. Sort, such as name asc (Name asc), descending (Name desc).