Giter Site home page Giter Site logo

o19s / match-query-parser Goto Github PK

View Code? Open in Web Editor NEW
25.0 11.0 3.0 44 KB

Search a single field with different query time analyzers in Solr

Home Page: http://opensourceconnections.com/blog/2017/01/23/our-solution-to-solr-multiterm-synonyms/

Java 100.00%
solr query-analysis synonyms match-qp relevance edismax relevant-search

match-query-parser's People

Contributors

epugh avatar omnifroodle avatar softwaredoug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

match-query-parser's Issues

the query actually don't work. and analyzer is not passed in runtime. Please fix.

In both cases analyzer is not picked up from analyze_as which can be clearly seen in parsedquery

Case 1

Query:
http://localhost:8983/solr/def/select?debugQuery=on&q={!match analyze_as=t_synonymized qf=nosynonymized}sea_biscuit

Output:
{ responseHeader: { status: 0, QTime: 0, params: { q: "{!match analyze_as=t_synonymized qf=nosynonymized}sea_biscuit", debugQuery: "on" } }, response: { numFound: 0, start: 0, docs: [ ] }, debug: { rawquerystring: "{!match analyze_as=t_synonymized qf=nosynonymized}sea_biscuit", querystring: "{!match analyze_as=t_synonymized qf=nosynonymized}sea_biscuit", parsedquery: "DisjunctionMaxQuery((nosynonymized:sea_biscuit))", parsedquery_toString: "(nosynonymized:sea_biscuit)", explain: { }, QParser: "MatchQParser", timing: { time: 0, prepare: { time: 0, query: { time: 0 }, facet: { time: 0 }, facet_module: { time: 0 }, mlt: { time: 0 }, highlight: { time: 0 }, stats: { time: 0 }, expand: { time: 0 }, terms: { time: 0 }, debug: { time: 0 } }, process: { time: 0, query: { time: 0 }, facet: { time: 0 }, facet_module: { time: 0 }, mlt: { time: 0 }, highlight: { time: 0 }, stats: { time: 0 }, expand: { time: 0 }, terms: { time: 0 }, debug: { time: 0 } } } } }
Here,
parsedquery: "DisjunctionMaxQuery((nosynonymized:sea_biscuit))",

Case 2

Query:
http://localhost:8983/solr/def/select?debugQuery=on&q={!match analyze_as=t_nosynonymized qf=synonymized}sea_biscuit

Output:
{ responseHeader: { status: 0, QTime: 0, params: { q: "{!match analyze_as=t_nosynonymized qf=synonymized}sea_biscuit", debugQuery: "on" } }, response: { numFound: 1, start: 0, docs: [ { id: "doc1", phonetic: [ "book", "hardcover", "four score and twenty" ], queryandindexphonetic: [ "book", "hardcover", "four score and twenty" ], indexphonetic: [ "book", "hardcover", "four score and twenty" ], queryphonetic: [ "book", "hardcover", "four score and twenty" ], synonymized: [ "seabiscuit", "sea biscuit the lonely horse" ], nosynonymized: [ "seabiscuit", "sea biscuit the lonely horse" ], queryphonetic_str: [ "book", "four score and twenty", "hardcover" ], _version_: 1614049012032209000, indexphonetic_str: [ "book", "four score and twenty", "hardcover" ], queryandindexphonetic_str: [ "book", "four score and twenty", "hardcover" ] } ] }, debug: { rawquerystring: "{!match analyze_as=t_nosynonymized qf=synonymized}sea_biscuit", querystring: "{!match analyze_as=t_nosynonymized qf=synonymized}sea_biscuit", parsedquery: "DisjunctionMaxQuery((synonymized:sea_biscuit))", parsedquery_toString: "(synonymized:sea_biscuit)", explain: { doc1: " 0.45207188 = weight(synonymized:sea_biscuit in 0) [SchemaSimilarity], result of: 0.45207188 = score(doc=0,freq=2.0 = termFreq=2.0 ), product of: 0.2876821 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from: 1.0 = docFreq 1.0 = docCount 1.5714287 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from: 2.0 = termFreq=2.0 1.2 = parameter k1 0.75 = parameter b 9.0 = avgFieldLength 5.0 = fieldLength " }, QParser: "MatchQParser", timing: { time: 0, prepare: { time: 0, query: { time: 0 }, facet: { time: 0 }, facet_module: { time: 0 }, mlt: { time: 0 }, highlight: { time: 0 }, stats: { time: 0 }, expand: { time: 0 }, terms: { time: 0 }, debug: { time: 0 } }, process: { time: 0, query: { time: 0 }, facet: { time: 0 }, facet_module: { time: 0 }, mlt: { time: 0 }, highlight: { time: 0 }, stats: { time: 0 }, expand: { time: 0 }, terms: { time: 0 }, debug: { time: 0 } } } } }

Here,
parsedquery: "DisjunctionMaxQuery((synonymized:sea_biscuit))"

Tutorial question ... analyzer=text_general_syn ...

On the tutorial is there a typo?

You mention using analyzer=text_general_syn but there are not any field names called text_general_syn. How does that analyzer name know what field to use?

Also for the new analyzers (like below), would I place them in the managed-schema file? or right in the solrconfig.xml file?

<fieldType name="synonymized" class="solr.TextField"> <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" format="solr" ignoreCase="false" expand="true" tokenizerFactory="solr.WhitespaceTokenizerFactory"/> <filter class="solr.PatternReplaceFilterFactory" pattern="(_)" replacement=" " replace="all"/> </analyzer> </fieldType>

Unable to boost the qf field

The following syntaxes in "bq" do NOT produce the expected boost:

<str name="bq">{!match qf=MY_FIELD analyze_as=my_analyzer search_with=term v=$q}^2</str>
or
<str name="bq">{!match qf=MY_FIELD^2 analyze_as=my_analyzer search_with=term v=$q}</str>

Note that with edismax, the above first syntax does NOT work either, while the second does work:

<str name="bq">{!edismax qf=MY_FIELD^2 ... v=$q}</str>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.