Search

Search Item Segments

Full-text personalized search that returns Segments from a Segmentation. The results are based on the provided searchQuery and also on the user's past interactions (purchases, ratings, etc.).

Based on the used Segmentation, this endpoint can be used for example for:

  • Searching within categories or brands
  • Searching within genres or artists

For example if the user is searching for "iPhone" this endpoint can return "cell phones" category.

You need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.

The returned segments are sorted by relevance (first segment being the most relevant).

It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.

post/{databaseId}/search/users/{userId}/item-segments/

Path parameters

databaseIdstring required

ID of your database.

userIdstring required

ID of the user for whom personalized search will be performed.

Request body

searchQuerystring required

Search query provided by the user. It is used for the full-text search.

countinteger required

Number of segments to be returned (N for the top-N results).

scenariostring

Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".

You can set various settings to the scenario in the Admin UI. You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.

The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.

cascadeCreateboolean

If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.

filterstring

Boolean-returning ReQL expression which allows you to filter recommended segments based on the segmentationId.

boosterstring

Number-returning ReQL expression which allows you to boost recommendation rate of some segments based on the segmentationId.

expertSettingsobject

Dictionary of custom options.

returnAbGroupboolean

If there is a custom AB-testing running, return the name of the group to which the request belongs.

reqlExpressionsobject

A dictionary of ReQL expressions that will be executed for each recommended Item Segment. This can be used to compute additional properties of the recommended Item Segments.

The keys are the names of the expressions, and the values are the actual ReQL expressions.

Example request:

{
  "reqlExpressions": {
    "countItems": "size(segment_items(\"categories\", 'segmentId'))"
  }
}

Example response:

{
  "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
  "recomms": 
    [
      {
        "id": "category-fantasy-books",
        "reqlEvaluations": {
          "countItems": 486
        }
      },
      {
        "id": "category-sci-fi-costumes",
        "reqlEvaluations": {
          "countItems": 19
        }
      }
    ],
   "numberNextRecommsCalls": 0
}

Response

successful operation

recommIdstring required

Id of the personalized search request

numberNextRecommsCallsinteger

How many times Recommend Next Items have been called for this recommId

abGroupstring

Name of AB-testing group to which the request belongs if there is a custom AB-testing running.

Changes

No recorded changes to this endpoint across all 1 revision of this API.