mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
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:
parent
24ad90cf59
commit
5428a8e5b4
@ -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] }),
|
||||
|
Loading…
Reference in New Issue
Block a user