Comments (3)
I'm guessing somewhere around here, we would need to have the ability to add STORED as an option on text fields:
Lines 70 to 71 in 0320b41
https://github.com/quickwit-oss/tantivy/blob/main/src/schema/text_options.rs#L27-L32
from tantiny.
Here's an example I found of using highlighted snippets:
from tantiny.
I haven't thought about this, but it's a valid usecase. It's definitely feasable, but it would significally change the API, so the correct approach requires more thought.
First of all, as you correctly said for this to work the text fields should be stored. I don't want it to be the default behavior because storing fields in the index takes space and reading stored fields is not free (as Tantivy documentation puts it Reading the stored fields of a document is relatively slow. (100 microsecs)
). So, this should be opt-in, maybe a stored
option for text
fields.
As performance goes, I would also make calculating ranges optional (e.g. index.search(query, with_match_ranges: true)
).
Also, note that in your example there is only one text field, but there might be more, so we need to return match_ranges
for every stored text field:
index.search('bersonal coder', fuzzy_distance: 1)
=>
[
{
id: "tt0118767",
match_ranges: {
text_field_1: [[21, 28]],
text_field_2: [[36, 39]],
}
}
]
And speaking of the search
method: since we need to return additional metadata with every document, it would be best to create a new entity (e.g. Tantiny::SearchResult
) that would contain this metadata along with documents ids, instead of returning an arbitrary hash.
That being said, modifying the source in your fork for your specific usecase shouldn't be very difficult. You would need to add the STORED
index option, and modify the search
method both in Rust and Ruby.
from tantiny.
Related Issues (8)
- How do I release Lock? HOT 1
- Failed to build gem HOT 1
- Error loading library HOT 8
- Custom tokenizer HOT 4
- Aggregations HOT 7
- Term types HOT 3
- in memory indexing
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 tantiny.