Comments (26)
thank you for the detailed report, I will look into it.
My first thought is that the query parser is transforming your "Administrator" to "administrator", but as it was indexed as "string" and not "text" it is held as "Administrator" in the index itself, and thus doesn't match.
assuming that's it then I agree that the query parser should not do this for string fields and I will make a fix.
from couchdb.
Yes, I mean in the index it is "Administrator" but you are not able query with the "A" as the query parser converts with the standard analyzer. you might say 'q=foo:Administrator' but the query parser is making it a term query on "administrator".
from couchdb.
"text" type means the value is analyzed. the Lucene analyzers typically force to lower case among other effects, which explains the new success.
from couchdb.
I still intend to make an enhancement. Assuming I'm right in my first comment you did nothing wrong, and I would like nouveau to do the right thing.
We know that "string" fields will not be analyzed, we need to tell the query parser to also not analyze the query string for "string" fields (and nouveau knows the index definition, so it does know which fields are "string" or "text", etc).
from couchdb.
But I tried to query with "admin", "administrator" and "Administrator" without any luck. Same holds for other values like "User". Thus I am suspecting something is wrong with the analyzed value from index or query not giving out the same result. Email being a special case where analyzer does not change the value, it matches.
from couchdb.
e.g, if you specified the "keyword" analyzer for the lastName field, the query parser won't lowercase it for you and it should then match.
from couchdb.
https://lucene.apache.org/core/9_10_0/core/org/apache/lucene/document/StringField.html vs https://lucene.apache.org/core/9_10_0/core/org/apache/lucene/document/TextField.html btw
from couchdb.
Yes, I mean in the index it is "Administrator" but you are not able query with the "A" as the query parser converts with the standard analyzer. you might say 'q=foo:Administrator' but the query parser is making it a term query on "administrator".
Can confirm that's the case. I modified the doc to give the "lastname": "administrator"
, then the query q=lastname:admin*
gave back the expected result.
from couchdb.
https://lucene.apache.org/core/9_10_0/core/org/apache/lucene/document/StringField.html vs https://lucene.apache.org/core/9_10_0/core/org/apache/lucene/document/TextField.html btw
I also modified the index to be of type text
rather than string
as: index("text", "lastname", doc.lastname, {"store": true});
and query started working even for uppercase "Admin1".
If that's expected behavior, I can update the index creation doc.
from couchdb.
Yeah, I got to understand that from the (archived) couchdb-lucene project
@rnewson , you'd still like to work on this (I can also try to check the issue) with the lower-casing of string query.
Or should I close the issue as I was using wrong field type?
from couchdb.
Related Issues (20)
- Configurable "Special Character" to allow JSON fieldnames beginning with underscore "_" HOT 3
- Chttpd request processing does not reset pdict predictably HOT 7
- Database size growing unexpectdly after upgrading couchdb to 3.2.2 from 3.1 HOT 1
- FreeBSD ARM64 CI Failures HOT 2
- Regex containing umlauts in square brackets not matching HOT 4
- Huge ram usage HOT 4
- Connection refused in Macbook M1 HOT 2
- Documentation: add default values HOT 1
- Database not reachable after snap auto refresh to 3.3.3 HOT 4
- Snap 3.3.3 breaks previous version (3.1.1) functionality HOT 11
- Flaky PasswordCacheTest failure HOT 1
- Enhancement Proposal: Improved UI/UX for CouchDB HOT 8
- couchspawnkillable: Cannot allocate memory HOT 2
- Allow for proxy provided `nonce` in chttpd HOT 4
- view has the wrong signature HOT 20
- until parameter for change request HOT 9
- Nouveau Availability HOT 9
- Replication fail due to invalid_json error HOT 2
- installed couchdb package post-installation script subprocess returned error exit status 20 HOT 1
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 couchdb.