Skip to content

Commit

Permalink
Panels bug fix4 (opensearch-project#249)
Browse files Browse the repository at this point in the history
* minor bug fix and updated unit tests

Signed-off-by: Shenoy Pratik <[email protected]>

* fixed date change issue

Signed-off-by: Shenoy Pratik <[email protected]>

* renamed relevance function to full text search

Signed-off-by: Shenoy Pratik <[email protected]>

* duplicate search text removed

Signed-off-by: Shenoy Pratik <[email protected]>
  • Loading branch information
ps48 authored and joshuali925 committed Nov 16, 2021
1 parent a315714 commit 1e1ab64
Show file tree
Hide file tree
Showing 14 changed files with 5,568 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
* SPDX-License-Identifier: Apache-2.0
*/

export const relevanceFunction = `## Relevance
export const fullTextSearchFunction = `## Full Text Search
---
The relevance based functions enable users to search the index for
documents by the relevance of the input query. The functions are built
The full text search based functions enable users to search the index for
documents by the full text search of the input query. The functions are built
on the top of the search queries of the OpenSearch engine, but in memory
execution within the plugin is not supported. These functions are able
to perform the global filter of a query, for example the condition
expression in a \`WHERE\` clause or in a \`HAVING\` clause. For more details
of the relevance based search, check out the design here: [Relevance
of the full text search based search, check out the design here: [Relevance
Based Search With SQL/PPL Query
Engine](https://github.com/opensearch-project/sql/issues/182)
Expand Down Expand Up @@ -64,19 +64,19 @@ parameters:
### Limitations
The relevance functions are available to execute only in OpenSearch DSL
but not in memory as of now, so the relevance search might fail for
queries that are too complex to translate into DSL if the relevance
The full text search functions are available to execute only in OpenSearch DSL
but not in memory as of now, so the full text search might fail for
queries that are too complex to translate into DSL if the full text search
function is following after a complex PPL query. To make your queries
always work-able, it is recommended to place the relevance commands as
close to the search command as possible, to ensure the relevance
always work-able, it is recommended to place the full text search commands as
close to the search command as possible, to ensure the full text search
functions are eligible to push down. For example, a complex query like
\`search source = people | rename firstname as name | dedup account_number | fields name, account_number, balance, employer | where match(employer, 'Open Search') | stats count() by city\`
could fail because it is difficult to translate to DSL, but it would be
better if we rewrite it to an equivalent query as
\`search source = people | where match(employer, 'Open Search') | rename firstname as name | dedup account_number | fields name, account_number, balance, employer | stats count() by city\`
by moving the where command with relevance function to the second
command right after the search command, and the relevance would be
by moving the where command with full text search function to the second
command right after the search command, and the full text search would be
optimized and executed smoothly in OpenSearch DSL. See [Optimization](https://github.com/opensearch-project/sql/blob/22924b13d9cb46759c8d213a7ce903effe06ab47/docs/user/optimization/optimization.rst)
to get more details about the query engine optimization.
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/


export {datetimeFunction} from './datetime';
export {conditionFunction} from './condition';
export {mathFunction} from './math';
export {relevanceFunction} from './relevance';
export {stringFunction} from './string';
export { datetimeFunction } from './datetime';
export { conditionFunction } from './condition';
export { mathFunction } from './math';
export { stringFunction } from './string';
export { fullTextSearchFunction } from './full_text_search';
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
datetimeFunction,
stringFunction,
conditionFunction,
relevanceFunction,
fullTextSearchFunction,
} from './functions';
import { pplDatatypes, pplIdentifiers } from './language_structure';

Expand Down Expand Up @@ -100,8 +100,8 @@ export const Group2 = {
value: conditionFunction,
},
{
label: 'Relevance',
value: relevanceFunction,
label: 'Full Text Search',
value: fullTextSearchFunction,
},
],
};
Expand Down
Loading

0 comments on commit 1e1ab64

Please sign in to comment.