Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panels bug fix4 #249

Merged
merged 5 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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