Comments (6)
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
CA-QC
is a separate issue, as -
is a special character in the search engine. Fixing this will be complicated, and is a bit too much off the path for Brightway2 development, at least for me. You can always do the following:
#!python
[x for x in Database("foo").search("bar", filter={'location': "ca"}) if x['location'] == 'QC-CA']
I will make a post to the Whoosh mailing list about the first case; note that the default analyzer is case-insensitive, but this is maybe applied inconsistently?
from brightway2-data.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
from brightway2-data.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Reply from Matt Chaput (whoosh author):
When you use the query parser, it runs the analyzer on the text and builds the query objects from the output.
If you construct query objects directly, you are giving them the *exact* text to search for.
Our search filter uses a query object:
And([Term(k, v) for k, v in filter.items()])
However, it is not yet clear to me how to work with the Whoosh machinery to make this case-insensitive.
from brightway2-data.
Original comment by Bernhard Steubing (Bitbucket: bsteubing, GitHub: bsteubing).
also the "mask" option does only work with lowercase.
Knowing this limitation, couldn't you simply convert all user input to location, mask, etc. to lowercase? Just an idea.
from brightway2-data.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
All search data stored as lowercase. Fixes #35. To get this beahviour in an existing database, use 'db.make_searchable(reset=True'
from brightway2-data.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Note that the fix doesn't help terms that have a dash, these have to be filtered outside the Whoosh search index.
from brightway2-data.
Related Issues (20)
- Moving to `bw_projects` needs a migration HOT 2
- Current test decoraters or base test class pollute project directory HOT 2
- missing vacuum attribute HOT 10
- Are concurrent database modifications supported in Brightway? HOT 1
- AttributeError: 'Config' object has no attribute 'is_test' HOT 2
- Can only join an iterable error while writing database to brightway2 HOT 2
- bw2data fails to migrate project to 4.0 format HOT 1
- data_store method opening too many files
- Create migration for pickle fields to save data in JSON
- move to cookiecutterlib HOT 1
- Use `Levenshtein` if installed
- bw2setup fails on latest version
- compat error for method missing is not helpful
- Allow LCIA methods to refer to biosphere flows which don't exist HOT 2
- Add requirement to fs module HOT 2
- Why no more pure Python wheels of `bw2data` on PyPi? HOT 1
- Use of `pydantic_settings` in `configuration.py` allows for environment variables
- Move from FT4 to FTS5
- Database event sourcing refactor HOT 5
- `multifunctional` import doesn't add new process types to `labels.node_types`
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 brightway2-data.