diff --git a/contrib/adsabs/src/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java b/contrib/adsabs/src/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java index 168b938f0..d010916d8 100644 --- a/contrib/adsabs/src/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java +++ b/contrib/adsabs/src/java/org/apache/lucene/queryparser/flexible/aqp/builders/AqpAdsabsSubQueryProvider.java @@ -773,7 +773,7 @@ public Query parse(FunctionQParser fp) throws SyntaxError { new SecondOrderCollectorTopN(200)), new SecondOrderCollectorCitesRAM(referencesWrapper)); - outerQuery.getcollector().setFinalValueType(FinalValueType.ABS_COUNT_NORM); + outerQuery.getcollector().setFinalValueType(FinalValueType.ABS_COUNT); return outerQuery; }; }); @@ -1096,7 +1096,7 @@ public Query parse(FunctionQParser fp) throws SyntaxError { SolrQueryRequest req = fp.getReq(); String input = fp.getString(); - String filterName = input.substring(1, input.length()-1); + String filterName = input.substring(1, input.length()-1).trim(); // pick the content stream (actually a filter) @@ -1189,11 +1189,11 @@ public Query parse(FunctionQParser fp) throws SyntaxError { public Query parse(FunctionQParser fp) throws SyntaxError { String input = fp.parseId(); - String toLoad = "abstract"; + String toLoad = "abstract title"; if (fp.hasMoreArguments()) toLoad = fp.parseId(); - int maxQueryTerms = 500; + int maxQueryTerms = 100; if (fp.hasMoreArguments()) maxQueryTerms = Math.min(fp.parseInt(), maxQueryTerms); diff --git a/contrib/adsabs/src/test/org/apache/solr/analysis/TestAdsabsTypeFulltextParsing.java b/contrib/adsabs/src/test/org/apache/solr/analysis/TestAdsabsTypeFulltextParsing.java index b56757728..8379f3697 100644 --- a/contrib/adsabs/src/test/org/apache/solr/analysis/TestAdsabsTypeFulltextParsing.java +++ b/contrib/adsabs/src/test/org/apache/solr/analysis/TestAdsabsTypeFulltextParsing.java @@ -1222,7 +1222,8 @@ public void testOtherCases() throws Exception { assertQ(req("q", "title:\"GBT Survey of 50 Faint Fermi\"~2"), "//*[@numFound>='4']"); - + //TODO: this test is intentionally left failing; it used to work until the scoring changes (i'd like to + // investigate more how the multi-token affects recall) assertQ(req("q", "title:\"A 350-MHz GBT Survey of 50 Faint Fermi γ-ray Sources for Radio Millisecond Pulsars\"", "indent", "true", "debugQuery", "true"), diff --git a/contrib/adsabs/src/test/org/apache/solr/search/TestAqpAdsabsSolrSearch.java b/contrib/adsabs/src/test/org/apache/solr/search/TestAqpAdsabsSolrSearch.java index 3fffbc39c..b3ec6d477 100644 --- a/contrib/adsabs/src/test/org/apache/solr/search/TestAqpAdsabsSolrSearch.java +++ b/contrib/adsabs/src/test/org/apache/solr/search/TestAqpAdsabsSolrSearch.java @@ -426,7 +426,7 @@ public void testSpecialCases() throws Exception { MatchNoDocsQuery.class); assertQueryEquals(req("defType", "aqp", "q", "similar(bibcode:XXX)"), - "+like:foo bar baz -BitSetQuery(1)", + "+like:foo bar baz title bitle -BitSetQuery(1)", BooleanQuery.class); assertQueryEquals(req("defType", "aqp", "q", "similar(bibcode:XXX, title)"), @@ -979,11 +979,11 @@ public void testSpecialCases() throws Exception { // useful() - ads classic implementation assertQueryEquals(req("defType", "aqp", "q", "useful(author:foo)"), - "SecondOrderQuery(SecondOrderQuery(SecondOrderQuery(author:foo, author:foo,*, collector=SecondOrderCollectorAdsClassicScoringFormula(cache=citations-cache, boost=float[] cite_read_boost, lucene=0.5, adsPart=0.5)), collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitesRAM(cache:citations-cache))", + "SecondOrderQuery(SecondOrderQuery(author:foo, author:foo,*, collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitesRAM(cache:citations-cache))", SecondOrderQuery.class); assertQueryEquals(req("defType", "aqp", "q", "all:(x OR z) useful(author:foo OR title:body)"), - "+(all:x all:z) +SecondOrderQuery(SecondOrderQuery(SecondOrderQuery((author:foo, author:foo,*) title:body, collector=SecondOrderCollectorAdsClassicScoringFormula(cache=citations-cache, boost=float[] cite_read_boost, lucene=0.5, adsPart=0.5)), collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitesRAM(cache:citations-cache))", + "+(all:x all:z) +SecondOrderQuery(SecondOrderQuery((author:foo, author:foo,*) title:body, collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitesRAM(cache:citations-cache))", BooleanQuery.class); @@ -997,11 +997,11 @@ public void testSpecialCases() throws Exception { // reviews() - ADS classic impl assertQueryEquals(req("defType", "aqp", "q", "reviews(author:foo)"), - "SecondOrderQuery(SecondOrderQuery(SecondOrderQuery(author:foo, author:foo,*, collector=SecondOrderCollectorAdsClassicScoringFormula(cache=citations-cache, boost=float[] cite_read_boost, lucene=0.5, adsPart=0.5)), collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitedBy(cache:citations-cache))", + "SecondOrderQuery(SecondOrderQuery(author:foo, author:foo,*, collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitedBy(cache:citations-cache))", SecondOrderQuery.class); assertQueryEquals(req("defType", "aqp", "q", "all:(x OR z) reviews(author:foo OR title:body)"), - "+(all:x all:z) +SecondOrderQuery(SecondOrderQuery(SecondOrderQuery((author:foo, author:foo,*) title:body, collector=SecondOrderCollectorAdsClassicScoringFormula(cache=citations-cache, boost=float[] cite_read_boost, lucene=0.5, adsPart=0.5)), collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitedBy(cache:citations-cache))", + "+(all:x all:z) +SecondOrderQuery(SecondOrderQuery((author:foo, author:foo,*) title:body, collector=SecondOrderCollectorTopN(200)), collector=SecondOrderCollectorCitedBy(cache:citations-cache))", BooleanQuery.class); // reviews2() - original impl @@ -1249,7 +1249,7 @@ public void testSubquery() throws Exception { streams.add(cs); - SolrQueryRequestBase req = (SolrQueryRequestBase) req("qt", "/bigquery", "q","(docs(fq_foo) OR docs(fq_bar)) AND bibcode:b4"); + SolrQueryRequestBase req = (SolrQueryRequestBase) req("qt", "/bigquery", "q","(docs(fq_foo) OR docs(fq_bar)) AND bibcode:b4", "debugQuery", "true"); req.setContentStreams(streams); assertQ(req,