-
Notifications
You must be signed in to change notification settings - Fork 831
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
Primary Sort ArangoSearch is not flexible, What's other way do with sort in ArangoSearch #20948
Comments
Hello @son2408 ! Unfortunately, you can specify Primary Sort fields/order only during view creation:
Here is the documentation page: https://docs.arangodb.com/3.11/index-and-search/arangosearch/performance/#primary-sort-order To solve your problem, you can switch to the recently implemented Inverted Index and Search Alias View: https://docs.arangodb.com/3.11/index-and-search/arangosearch/search-alias-views-reference/#how-to-use-search-alias-views. With these new functionality one can achieve your desired scenario:
If you have any further questions feel free to ask them as well! |
@alexbakharew thanks you |
Hello @alexbakharew I can't add new index of a collection into search-alias exists. if I upadate indexes property, it's sync all, I don't expect this. |
@alexbakharew how to do it ? |
Now, I want add new index of collection b into search-alias "r" exists. I don't affect indexes before :( |
@alexbakharew by your suggest, I request api update search-alias with this body?
|
Hello @son2408
Do you mean that the update of the search-alias view with exactly one new index has the same execution time as creating arangosearch view for all collections? |
"operation": "string" is incorrect here. https://docs.arangodb.com/3.11/index-and-search/arangosearch/search-alias-views-reference/#view-modification You can use either "add" or "del". Default value is "add". So in your case you can simply omit it. |
@son2408 I suspect that in these 2 indexes you have different primary sort orders. So the order should be the same in all indexes.
|
@alexbakharew I want create sort order both asc and desc for a field in Inverted Index. Therefore it causes the above error. If only choose one sort order, I think this it's not reasonable. |
@alexbakharew. I try create sort order both asc and desc on a field, but i see it only work with asc :( |
Hi @son2408!
Unfortunately, I wasn't able to reproduce this error by specifying different sorting order for the same field. I got this error when I tried to create a view with indexes which have different sorting orders. Could you please provide collection, indexes and view definitions for more detailed info?
Under the hood in the index there is no data duplication. It means that we store documents in index only once and apply sorting orders which you have defined in index definition. As a result, your documents in index will be sorted either in ascending or in decreasing order. |
Hello @alexbakharew. If a field can sort asc or desc, should I index sort this field by your suggestion? |
@alexbakharew In fact, when client use my application, they want view oldest or lastest data by time. I can't force them only once direct sort |
@alexbakharew How to index sort a field that I can query sort either in ascending or in decreasing order ? If with a field I create two indexes, one for ascending one for decreasing and if i need index sort for 10 fields i will create 20 indexes. I think this is a bad idea |
Hi @son2408! Unfortunately, it is only possible to gain performance advantage for the order, which is specified in PrimarySort definition. |
My Environment
Component, Query & Data
ViewConfig:
Problem:
My view links many collections. When I add a new collection to this view, I can't add new field sort to current view config. If I remove this view after create new, it will take a lot of time and we can't do anything during save view.
Expected result:
I want add new sort field without create new view, or what's other way work with sort arangosearch ?
The text was updated successfully, but these errors were encountered: