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
Querying returns no results? #14
Comments
This is because by default the |
As for the last cURL request, I'm not sure 🤔 If you create this index without fast fuzzy being enabled ( |
Okay, I think I know what's going on here. This is a side effect of adding If you remove |
So in this bug, you are right that was the cause. I copied this example from the book and assumed I was hitting the same issue. What I am actually seeing is that when I index a document with a date field, I am no longer able to index any more documents. # curl -X DELETE 'http://localhost:4040/indexes/my-index'
{"data":"index deleted","status":200}#
# cat a.json
{
"name": "my-index",
"writer_buffer": 6000000,
"writer_threads": 1,
"reader_threads": 1,
"max_concurrency": 10,
"search_fields": [
"title"
],
"storage_type": "memory",
"use_fast_fuzzy": false,
"strip_stop_words": false,
"set_conjunction_by_default": false,
"fields": {
"title": {
"type": "text",
"stored": true
},
"description": {
"type": "text",
"stored": true
},
"id": {
"type": "u64",
"indexed": true,
"stored": true,
"fast": "single"
},
"ts": {
"type": "date",
"stored": false,
"indexed": true,
"fast": "single"
}
},
"boost_fields": {}
}
# curl -X POST -d@a.json -H "Content-Type: application/json" http://127.0.0.1:4040/indexes
{"data":"index created","status":200}
# cat c.json
{
"title": ["Hello, World2"],
"id":[4]
}
# curl -X POST -d@c.json -H "Content-Type: application/json" http://localhost:4040/indexes/my-index/documents?wait=true
{"data":"added documents","status":200}
# curl -X POST 'http://localhost:4040/indexes/my-index/commit'
{"data":"changes committed","status":200}
# curl 'http://localhost:4040/indexes/my-index/search?query=*&mode=normal'
{"data":{"count":1,"hits":[{"doc":{"id":[4],"title":["Hello, World2"]},"document_id":"8295453496340348446","ratio":1.0}],"time_taken":0.0001392010017298162},"status":200}
# cat b.json
{
"title": ["Hello, World2"],
"id":[4],
"ts":[1630097583]
}
# curl -X POST -d@b.json -H "Content-Type: application/json" http://localhost:4040/indexes/my-index/documents?wait=true
{"data":"added documents","status":200}
# curl -X POST 'http://localhost:4040/indexes/my-index/commit'
{"data":"changes committed","status":200}
# curl 'http://localhost:4040/indexes/my-index/search?query=*&mode=normal'
{"data":{"count":1,"hits":[{"doc":{"id":[4],"title":["Hello, World2"]},"document_id":"8295453496340348446","ratio":1.0}],"time_taken":0.0001936009939527139},"status":200} Adding a document with a date field doesn't produce an error, but seems to corrupt the index. In my original setup, I always had a date field, and I wasn't seeing any documents get indexed, which is why I assumed the two errors were the same. Once this happens even documents without the |
Ill move this to a new issue as I don't believe they're related. |
I can't seem to get any results from lnx. I'm using commit
e9804944edc8a7c0af24ee3ba8397b87f1640b5f
. I built lnx usingcargo build --release
, then starting it with/usr/local/bin/lnx -p 4040
.I can't figure out what I'm doing wrong here.
The text was updated successfully, but these errors were encountered: