Authored by Guru Deshkulkarni.
Introduction
In specific scenarios, using Elasticsearch can lead to retrieving inappropriate results that might have business impacts. The following article provides examples of unwanted results that the Elasticsearch retrieves.
Scenario 1.
A customer has two product offers with the following characteristics:
Offer 1 (PO-1)
Characteristics (1):
FieldName: Bandwidth
FieldValue: 100MB
Characteristics (2):
FieldName: MobileRAM
FieldValue: 1GB
Offer 2 (PO-2)
Characteristics (1):
FieldName: Bandwidth
FieldValue: 1 GB
Characteristics (2):
FieldName: MobileRAM
FieldValue: 1GB
When you send the following SearchString: CharacteristicFieldName: “Bandwidth” AND CharacteristicFieldValue: 1 GB, the expected result would be PO-2. However, the results would include both PO-1 and PO-2, because the index of the page list would be ignored, and the system checks for FieldName and FieldValue properties available with “Bandwidth” and "1GB" values, respectively. This situation occurs despite the fact that these property values are not part of the same page list index.
Scenario 2.
A customer has two auto care plans with the following characteristics:
Case ID A-1:
pyProductList(1)
pyProductName = “Auto Plan A”
ProductInventoryList(1).pyCountryName = “India”
ProductInventoryList(2).pyCountryName = “United States”
ProductInventoryList(3).pyCountryName = “United Kingdom”
pyProductName = “Auto Plan B”
ProductInventoryList(1).pyCountryName = “Egypt”
ProductInventoryList(2).pyCountryName = “France”
ProductInventoryList(3).pyCountryName = “Australia”
The system returns A-1 even though the following filter specified in the report definition suggests different outcome:
pyProductList(1).ProductInventoryList(2).pyCountryName CONTAINS “France”
The indexes for the page lists are ignored when applying the filter, so A-1 matches the filter even though the value France refers to ProductInventoryList(2), not to ProductInventoryList(1). Filters on values in page lists and page groups function as any filters.
Scenario 3.
A customer searches the list of practitioners by using specifying their language and specialty.
David Barone (P-100101)
Specialities (1):
Value: Internal Medicine
Language (1):
Value: English
Code: Eng
Language (2):
Value: Spanish
Code: Spa
Adeline Wright (P-100222)
Specialities (1):
Value: Cardiovascular Disease
Language (1):
Value: English
Code: Eng
The system returns both “David Barone” and “Adeline Wright” results despite the following search string:
Speciality: “Internal Medicine” AND Language: “English”
Because the index of the page list would be ignored, and the system checks for FieldName and FieldValue properties available with values "Internal Medicine" and "English", respectively. This situation occurs despite the fact that these property values are not part of the same page list index.
Scenario 4.
A customer requires to do a transaction search of international credit card.
Cred Transaction search (CTS -1)
Transaction Details (1):
Location: California, United States
Amount: 200
Currency: USD
Transaction Details (2):
Location: California, United States
Amount: 1200
Currency: USD
Transaction Details (3):
Location: Cancun, Mexico
Amount: 1200
Currency: Mex$
The system returns both “Transaction Details (2)” and “Transaction Details (3)” results despite the following search string:
Currency: “USD” AND Amount >= “1200”
Because the index of the page list would be ignored, and the system checks for fieldname and fieldvalue properties available with values "USD" and "1200" respectively. This situation occurs despite the fact that these property values are not part of the same page list index.
To avoid inappropriate results in such search scenarios, it is recommended to create declare indexes.