Phrase Detection
Phrase detection is another unique feature of NoChannel Search. They are implemented to connect two or multiple different words into a phrase.
For example, users may search the phrase "phone protector". Both these words are meaningful individually and retrieve separate results in the absence of phrase detection. This will return irrelevant results for the person who is searching for a phone protector. However, with implemented phrase detection in the query pipeline, these two words "phone" and "protector" act as a single word or phrase and will retrieve all the relevant results for a mobile phone protector.
To understand the concept of phrase detection better, we will create an example on the catalog pipeline.
The API call to create phrase detection is:
POST https://api.upstartcommerce.com/v1/search/phrase
The following code block represents the creation of phrase detection.
Notice that the priority of the phrase is set to 0, which is the highest priority. This means that any other phrases with the words "phone" or "protector" in it will be given less priority as compared to this one as both these terms are present together.
This endpoint allows users to attach phrase detection with a query pipeline. Users can attach one phrase detection with multiple query pipelines. The API call to attach the created phrase detection is:
POST https://api.upstartcommerce.com/v1/search/phrase/attach/phrase_id/to/querypipeline
Notice that the phrase's id is added before 'to' and after it, the query pipeline id is defined.
The detach function allows users to remove a particular phrase from the query pipeline. The API call to detach the created phrase is:
POST https://api.upstartcommerce.com/v1/search/phrase/detach/phrase_id/from/querypipeline
Notice that the id of the phrase is added before 'from' and after it, the query pipeline id is defined.
The following code block is the representation of phrase detection in the search code block:
In the example below, the search retrieves two values that contain the phrase "phone protector" in one or multiple fields.
Multiple functions such as CRUD operations and determination of properties can be performed via different API calls. You can find the remaining operations for APIs here.