Re: Use custom score in ConstantScoreQuery

2019-12-09 Thread Aditya Varun Chadha
By wrapping the constant score query inside a BoostQuery? That’s how elasticsearch handles boosts on arbitrary queries, for example. On Mon 9. Dec 2019 at 10:42, Stamatis Zampetakis wrote: > Thanks for you reply Adrien! > Can you clarify what is the second way? > At the moment I haven't found

Re: Use custom score in ConstantScoreQuery

2019-12-09 Thread Stamatis Zampetakis
Thanks for you reply Adrien! Can you clarify what is the second way? At the moment I haven't found a way (apart from creating my own Query classes) to say that a query will always return a score of 0.5 for each document. On Mon, Dec 9, 2019 at 8:16 AM Adrien Grand wrote: > Hi Stamatis, > > I

RE: Use custom score in ConstantScoreQuery

2019-12-09 Thread Uwe Schindler
Hi, Just add a BoostQuery with a boost factor of 0.5 around the ConstantScoreQuery. It's just one line more in your code. I don't understand why we would need separate query classes for this. Uwe - Uwe Schindler Achterdiek 19, D-28357 Bremen https://www.thetaphi.de eMail:

How can i specify a custom Analyzer for a Field of Document?

2019-12-09 Thread 小鱼儿
Directory indexDataDir = FSDirectory.open(Paths.get("index_data")); Analyzer analyzer = MyLuceneAnalyzerFactory.newInstance(); IndexWriterConfig iwc = new IndexWriterConfig(analyzer); iwc.setOpenMode(OpenMode.CREATE); iwc.setRAMBufferSizeMB(256.0); IndexWriter indexWriter = new

Re: How can i specify a custom Analyzer for a Field of Document?

2019-12-09 Thread Mikhail Khludnev
You can check how SolrAnalyzer switches chains across fields. On Tue, Dec 10, 2019 at 9:41 AM 小鱼儿 wrote: > Directory indexDataDir = FSDirectory.open(Paths.get("index_data")); > Analyzer analyzer = MyLuceneAnalyzerFactory.newInstance(); > IndexWriterConfig iwc = new IndexWriterConfig(analyzer);