searching by full token symbol (#564)

* searching by full token symbol


regular expression used

* search by full names


match partial data


useless comments deleted


log deleted

* make search text uppercase

* data author and description added in query fields

* working search combined with sorting and filtering

Co-authored-by: claudia.holhos <claudia.holhos@hpm.ro>
This commit is contained in:
claudiaHash 2021-05-25 11:23:48 +03:00 committed by GitHub
parent 24ad90cf59
commit 5428a8e5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -65,6 +65,9 @@ export function getSearchQuery(
? // eslint-disable-next-line no-useless-escape
`(service.attributes.additionalInformation.categories:\"${categories}\")`
: text || ''
// HACK: resolves the case sensitivity related to dataTokenInfo.symbol
searchTerm = '*' + searchTerm.toUpperCase() + '*'
searchTerm = addTypeFilterToQuery(searchTerm, serviceType)
return {
@ -72,7 +75,15 @@ export function getSearchQuery(
offset: Number(offset) || 21,
query: {
query_string: {
query: `${searchTerm} -isInPurgatory:true`
query: `${searchTerm} -isInPurgatory:true`,
fields: [
'dataTokenInfo.name',
'dataTokenInfo.symbol',
'service.attributes.main.name',
'service.attributes.main.author',
'service.attributes.additionalInformation.description'
],
default_operator: 'AND'
}
// ...(owner && { 'publicKey.owner': [owner] }),
// ...(tags && { tags: [tags] }),