Comments (6)
sort by is only supported on numerical fields. Why do you want to sort by text field?
from tantivy.
sort by is only supported on numerical fields. Why do you want to sort by text field?
Because my source data is from MongoDB. Its id field is ObjectId type, and there is no way to store ObjectId type as a number to tantivy. Therefore, I use text to store the id field. For keeping the order, I would like to sort by the id field with text type.
from tantivy.
I suggest we just remove the ability to sort the index by something. It has brought more bugs, confusion than any other feature.
from tantivy.
Because tantivy has its own docId field, and tantivy's interface does not provide a save method (override by query). This leads to the confusion of query results in concurrent testing (single-threaded modification + multithreaded query). So, I think index sort is necessary.
from tantivy.
I don't understand your sentence.
from tantivy.
For keeping the order, I would like to sort by the id field with text type.
Why do you want to keep order in the tantivy index?
I suggest we just remove the ability to sort the index by something. It has brought more bugs, confusion than any other feature.
I also don't think the maintenance cost of it justifies potential gains currently. In practice there's little to no benefit, but some confusion about it.
Range queries may be accelerated by using binary search instead of a full scan, but we don't do that currently.
Compression may be improved, we don't have much data about that though.
Tantivy users may have custom queries on top of sorting. Hard to tell if and how they use it, but only performance should be affected when removing it.
If we decide to remove it I would add a deprecation warning in the upcoming release.
from tantivy.
Related Issues (20)
- add `top_metrics` aggregation
- Planned removal of index sorting in 0.23.0 HOT 4
- Regular Expression Queries HOT 1
- Occur - Phrase query with slop HOT 1
- Negative Term HOT 2
- FuzzyTermQuery, PhrasePrefixQuery, PhraseQuery --> Snippets / actual matches
- tantivy vs Lucene benchmark confusion HOT 5
- Questions about the details of how Tantivy manages index files. HOT 2
- Replace PreTokenizedString
- support multiple modes of execution for fastfield range query
- Addition of a migration guide from Lucene to Tantivy HOT 2
- Store DateTime as nanos in docstore HOT 2
- QueryParser raises SyntaxError when combining field prefix with nested searchstring
- Random Crash in Bitpacking/Columnar when Merging Segments HOT 3
- Highligh feature not work? HOT 1
- Any plan to support learned sparse vector search? HOT 3
- Implementing Block WAND optimization for more queries
- Adding Function Score Query HOT 4
- Implement "minimum number should match" on BooleanQuery HOT 2
- Flaky Test test_cancel_cpu_intensive_tasks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tantivy.