Comments (5)
I agree. It would be nice if this code could work in either (pure) Lucene, Solr, or ElasticSearch. In truth, the idea itself is not fairly complicated: take the user query, expand it into all possible synonym combinations, parse each of those queries as you normally would, and then combine them back together. There's nothing in there that explicitly depends on EDisMax, or even Solr.
I think the best way I could accomplish this for now would be to make QParserPlugin its own class rather than a subclass of ExtendedDisMaxQParserPlugin. It could take ExtendedDisMaxQParserPlugin as a constructor argument and delegate to it, rather than subclassing it. Then the code would be fairly self-contained.
from hon-lucene-synonyms.
Yep. If done right, the core code could be a new Lucene module, usable from any query parser.
Doing a Lucene module would be a nice first step, then we can tackle Solr and eDisMax next. It's also the preferred/proper way of separating code between Lucene and Solr.
from hon-lucene-synonyms.
hi,
and firstly great work, i'm a newbie to lucene/solr but am getting my head around what you've done pretty quickly.
I was thinking could it be generalized further? i.e. not just handling synonyms but any sort of related term expansion.
e.g. narrower terms, related terms etc.
At the moment I'm looking at using the code here to allow our taxonomy which contains terms to be expanded into the query, where the taxonomy has narrower terms they'd be added to the query with a lower priority.
does that make sense?
from hon-lucene-synonyms.
@mickdelaney : I think I understand what you're proposing. It's a little bit beyond the scope of what I tried to do with this plugin, though. I'm only trying to use a flat list of synonyms, whereas it sounds like you want to weight certain synonyms over others.
I think you could probably modify the code pretty easily to do what you want. Although, since the default SynonymFilterFactory
(which I use) doesn't support weighted synonyms, you'd have to rewrite a lot of that from scratch, as well.
from hon-lucene-synonyms.
@janhoy: The more I work on this plugin, the more it seems to become inextricably dependent upon Solr. I don't think it's very realistic anymore to imagine generalizing it to Lucene/ElasticSearch.
And anyway, the idea itself is pretty trivial. If folks want it for Lucene or ElasticSearch, they should be able to code it up themselves using a basic string manipulation layer on top of the query engine.
However, I'm at a point now where it would be easy to allow people to use plain ol' dismax and lucene instead of edismax as the query parser. I dunno if there's much interest in that, though - aren't all of us just using edismax anyway? 😉
from hon-lucene-synonyms.
Related Issues (20)
- Adding .jar to $SOLR_HOME generates class not found exception? HOT 4
- Compatibility with Solr 6.0.0? HOT 2
- Matches all docs if bf (Boost Function) present HOT 5
- Does it supports fielded search in q parameter? HOT 1
- Is it possible to use it with lucene? HOT 1
- TooManyClauses: maxClauseCount is set to 1024 HOT 2
- Too much memory consumed on queries matching many synonym groups HOT 3
- Does not seem to support singular and plural HOT 3
- Does not return expanded synonyms in highlight terms
- SOLR is slow at first synonym query but quite fast for later queries HOT 1
- Error loading class 'com.github.healthonnet.search.SynonymExpandingExtendedDismaxQParserPlugin' HOT 4
- Error when doing a search
- Not finding any matches... am I being stupid? HOT 2
- boost parameter is not working HOT 2
- Need help on finding logs after synonym expansion for solr HOT 2
- synonyms.constructPhrases not working when synonyms.bag is used...
- Facing error when adding Queryparser to solrconfig.xml
- Allow configuring defaults
- boost Not working when searching for a Synonym
- IS this project Supported any more Beyond Solr 5
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 hon-lucene-synonyms.