Movatterモバイル変換


[0]ホーム

URL:


Dev guideRecipesAPI ReferenceChangelog
Dev guideRecipesUser GuidesNuGetDev CommunityOptimizely AcademySubmit a ticketLog InCross-platform products
Dev guide
All
Pages
Start typing to search…

Autocomplete selection

Select autocomplete field

Autocomplete, word completion, type-ahead, or search-as-you-type, predicts the rest of a word a user is typing.

TheAutocomplete method will build an autocomplete request for the typed query. The method needs to specify the field and use theAutoCompleteOperators instance for filtering and limiting the result. Currently, Optimizely only supports the field with the typeString orIEnumerable<string>.

The following example gets the suggestion with filter value “shoe” and gets the ten most relevant results:

var autocompleteOperator =  new AutoCompleteOperators().Value(“shoe”) //mandatory.Limit(10); //optionalvar query = queryBuilder.ForType<MyDocumentType>()  .Autocomplete(x=>x.Property, autocompleteOperator).ToQuery().BuildQueries();

TheValue method is mandatory for an autocomplete query, and the result will be based on the value of the parameter:

  • Can be one or more words and in the same word order.
  • Each word can be a maximum of ten characters, when longer, no suggestions are returned.
  • If the value consists of only an empty string, then no autocomplete suggestions are retrieved.
  • Punctuation characters will be ignored when matching.
  • HTML tags will not match with results.

Limit_ is optional for limiting the results. The default value is 10, and the max value is 1,000.

Updated 23 days ago



[8]ページ先頭

©2009-2025 Movatter.jp