1
votes

Need help, I have an azure index called customer and have two fields in it customers & contacts, I have applied boost function for both the fields with boost 100 & 90, the problem is when I search any text it returns customer related relevance first and then contacts relevance.

Eg: If I search for "Johnson" It will return all the customer details with Johnson first and then contact details even if the contact name matches "Johnson"

List of records displayed.

Record 1: This is customer

  1. Johnson & tyson Segment: Enterprise | Vertical: Healthcare | Country: US

Record 2: This is contact however it is associated with customer "Johnson and tyson"

  1. Michael Walton Customer:Johnson and tyson | Segment: Enterprise | Vertical: Pharmaceutical

Record 3: This is contact however it is associated with customer "Johnson and tyson"

  1. Henri Vliegen Customer:Johnson and tyson | Segment: Ent | Vertical: Pharmaceutical

Record 4: This is contact it is associated with customer "WST"

  1. Henri Johnson Customer:WST | Segment: Enterprise | Vertical: Pharmaceutical

So in this way records are displayed its most probably on scoring however I want the relevance name to be displayed first like record 4 is contact and it should have been in place of record 2 since Johnson is the last name

2
Tip: Add the azure-search tag to Azure Search related questions to get the attention of the Azure Search engineering team. :)Bruce Johnston

2 Answers

1
votes

I believe that it's because you're boosting with the same values, so it's like this:

if(Customer.Contains("Johnson") || (Contact.Contais("Johnson"))
{
   //display
}

//PS: this statement is just to clarify that Contact and Customer name have the same importance.

Try to boost with different values, and I believe it will work. (100 for Customer and 90 for Details).

UPDATE

It seems that you are indexing first and last name separately. If you have a field "fullname" and boost through it, probably you'll get the expected result. Another option is create a scoring profile using those fields:

https://azure.microsoft.com/en-us/documentation/articles/search-get-started-scoring-profiles/

0
votes

I read the question several times. While the question mentions that you have one index, the records displayed imply that you actually have two search indexes. Is this correct? I've been working on a training course for Azure Search, which discusses indexes and scoring in-depth.

At this time, Azure Search does not support cross-index queries. For that reason, if my understanding of your problem is correct, you'd have to run two queries: The first on the Customer index and the second on the Contacts index. Part of the reason that Azure Search is able to execute searches so quickly is because its a flattened out data structure, which allows for fast look-ups and queries. However, you're scenario implies something relational.

Am I misunderstanding your question?