Skip to content

Commit

Permalink
Documentation: Added words ranking parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
speedblue committed May 27, 2014
1 parent 1bd2c15 commit 2754c3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,18 @@ You can retrieve all settings using the `getSettings` function. The result will
* *Control part of the ranking*.<br/>(see the ranking parameter for full explanation) Matches in attributes at the beginning of the list will be considered more important than matches in attributes further down the list. In one attribute, matching text at the beginning of the attribute will be considered more important than text after, you can disable this behavior if you add your attribute inside `unordered(AttributeName)`, for example `attributesToIndex: ["title", "unordered(text)"]`.
* **attributesForFaceting**: (array of strings) The list of fields you want to use for faceting. All strings in the attribute selected for faceting are extracted and added as a facet. If set to null, no attribute is used for faceting.
* **attributeForDistinct**: The attribute name used for the `Distinct` feature. This feature is similar to the SQL "distinct" keyword: when enabled in query with the `distinct=1` parameter, all hits containing a duplicate value for this attribute are removed from results. For example, if the chosen attribute is `show_name` and several hits have the same value for `show_name`, then only the best one is kept and others are removed. **Note**: This feature is disabled if the query string is empty and there isn't any `tagFilters`, nor any `facetFilters`, nor any `numericFilters` parameters.
* **ranking**: (array of strings) controls the way results are sorted.<br/>We have eight available criteria:
* **ranking**: (array of strings) controls the way results are sorted.<br/>We have nine available criteria:
* **typo**: sort according to number of typos,
* **geo**: sort according to decreassing distance when performing a geo-location based search,
* **words**: sort according to the number of query words matched by decreasing order. This parameter is useful when you use `optionalWords` query parameter to have results with the most matched words first.
* **proximity**: sort according to the proximity of query words in hits,
* **attribute**: sort according to the order of attributes defined by attributesToIndex,
* **exact**:
* if the user query contains one word: sort objects having an attribute that is exactly the query word before others. For example if you search for the "V" TV show, you want to find it with the "V" query and avoid to have all popular TV show starting by the v letter before it.
* if the user query contains multiple words: sort according to the number of words that matched exactly (and not as a prefix).
* **custom**: sort according to a user defined formula set in **customRanking** attribute.
* **asc(attributeName)**: sort according to a numeric attribute by ascending order. **attributeName** can be the name of any numeric attribute of your records (integer, a double or boolean).
* **desc(attributeName)**: sort according to a numeric attribute by descending order. **attributeName** can be the name of any numeric attribute of your records (integer, a double or boolean). <br/>The standard order is ["typo", "geo", "proximity", "attribute", "exact", "custom"]
* **desc(attributeName)**: sort according to a numeric attribute by descending order. **attributeName** can be the name of any numeric attribute of your records (integer, a double or boolean). <br/>The standard order is ["typo", "geo", "words", "proximity", "attribute", "exact", "custom"]
* **customRanking**: (array of strings) lets you specify part of the ranking.<br/>The syntax of this condition is an array of strings containing attributes prefixed by asc (ascending order) or desc (descending order) operator.
For example `"customRanking" => ["desc(population)", "asc(name)"]`
* **queryType**: Select how the query words are interpreted, it can be one of the following value:
Expand Down

0 comments on commit 2754c3a

Please sign in to comment.