Giter VIP home page Giter VIP logo

Comments (6)

PSeitz avatar PSeitz commented on June 9, 2024

sort by is only supported on numerical fields. Why do you want to sort by text field?

from tantivy.

gy0801151351 avatar gy0801151351 commented on June 9, 2024

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.

fulmicoton avatar fulmicoton commented on June 9, 2024

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.

gy0801151351 avatar gy0801151351 commented on June 9, 2024

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.

fulmicoton avatar fulmicoton commented on June 9, 2024

I don't understand your sentence.

from tantivy.

PSeitz avatar PSeitz commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.