Search issues fix#641
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/oceanprotocol/market/6AZJVnxziczyxZEjD2cb8xLScgk9 |
There are still some issues unresolved yet that I'm working on. |
| should: [ | ||
| { | ||
| query_string: { | ||
| query: `${searchTerm}`, |
There was a problem hiding this comment.
searchTerm differs in query_string you need to manually add OR between the words . in match_prase it's exactly the string the user inputs.
| 'service.attributes.additionalInformation.description', | ||
| 'service.attributes.additionalInformation.tags' | ||
| ], | ||
| default_operator: 'AND', |
There was a problem hiding this comment.
remove this line, it shouldn't be AND
There was a problem hiding this comment.
I added 'AND' as default op because using OR would give a match for every word in search string. For "worldlist used by" I got matches for assets that only contain "used" in their description/ title/ etc
There was a problem hiding this comment.
yes, please use the searchTerm formated as described above with 'OR' between each word. "worldlist used by" would become "worldlist OR used OR by", just in query_string, not in match_phrase. Because you didn't add OR the query wasn't working properly that's why the results were not ok
There was a problem hiding this comment.
Didn't used 2 different search terms on query_string and match_phrase there's where the problem came from. Please ignore the comments.
| `(service.attributes.additionalInformation.categories:\"${categories}\")` | ||
| : text || '' | ||
|
|
||
| if (searchTerm.startsWith('did:op:')) { |
There was a problem hiding this comment.
Removed it because searching by id that included "did:op:" in the beginning gave no result. Since the address that follows differentiates the assets, I thought that could be a solution.
There was a problem hiding this comment.
it should work without removing did:op. Comment it for now. It work ok in my tests without removing did:op
There was a problem hiding this comment.
searching for a2B8b3aC4207CFCCbDe4Ac7fa40214fd00A2BA71 is not working anyway
| searchTerm = searchTerm.substring(7) | ||
| } | ||
| // HACK: resolves the case sensitivity related to dataTokenInfo.symbol | ||
| searchTerm = '*' + searchTerm.toUpperCase() + '*' |
There was a problem hiding this comment.
stop adding * at the start and end of the string
There was a problem hiding this comment.
but it creates problems in other places. Searching for datatoken symbol will be fixed in oceanprotocol/aquarius#492
There was a problem hiding this comment.
Oh, ok then I'll remove it. That was the only issue * resolved.
|
We'll tweak the query after these changes are implemented. |
|
Ok, i'll play with it a bit and see how relevant are the result and if i can improve the query even more. |
|
Not sure if a |
|
it's ok, the secret is that we order them properly. We need to ad the sort criteria, after score. Currently they are sorted by created or if no sort filter is specified aquarius sorts them by id (it's not ok, an issue was created). The scope is to create multiple queries and order the matches. For example in the current queries |
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
|
I removed the |
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
While this seems to be possible (check links below) it is far too complex to handle in this pr. It is nice to have indeed and I will create a new issue for it https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-word-delimiter-tokenfilter.html |
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
…col/market into fix/619-search-issues
|
There already a lot of improvements here. I have commented One last test from someone else please. |
|
using this new search strategy in the background is already super valuable and seems to work well after some quick tests. One important, because very prominent, search which I found to be not working at all is the |
|
Ok, thanks on that. I remember now, i wanted to remove those but didn't finish. This way there is a bug if you click on your link and then search for something else (delete address and type something else ) nothing will happen. |
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
|
Code Climate has analyzed commit 44bb3aa and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
|
Ok, it should be working now ok. |
The search after link clicking works perfectly. Since what I tested, the rest of the search works as it did before the last push. I think we could finally merge it. |
|
It's a big improvement on before, all of the issues I mentioned above are fixed now. |




Fixes #619 .
Changes proposed in this PR: