Commit da9ef80db6b0a15b3f36b345e57754e063cc36a6
1 parent
66ab2eb5
fix containing/within
Showing
8 changed files
with
32 additions
and
15 deletions
docker/Dockerfile
1 | 1 | # Automatically generated Dockerfile |
2 | -# - Build 2016-12-15 07:39 | |
2 | +# - Build 2016-12-16 11:24 | |
3 | 3 | # - Lucene/Solr version 6.3.0 |
4 | -# - Mtas release 20161215 | |
4 | +# - Mtas release 20161216 | |
5 | 5 | # |
6 | 6 | |
7 | 7 | FROM ubuntu:16.04 |
... | ... | @@ -15,7 +15,7 @@ WORKDIR "/root" |
15 | 15 | |
16 | 16 | RUN mkdir lib |
17 | 17 | |
18 | -ADD https://github.com/meertensinstituut/mtas/releases/download/20161215/mtas-6.3.0.jar /root/lib/ | |
18 | +ADD https://github.com/meertensinstituut/mtas/releases/download/20161216/mtas-6.3.0.jar /root/lib/ | |
19 | 19 | |
20 | 20 | RUN apt-get update && apt-get install -y lsof software-properties-common python-software-properties apache2 curl subversion \ |
21 | 21 | && solrurl=$(curl -s 'http://www.apache.org/dyn/closer.lua/lucene/solr/6.3.0/solr-6.3.0.tgz' | grep -o '<strong>[^<]*</strong>' | sed 's/<[^>]*>//g' | head -1) \ |
... | ... | @@ -54,9 +54,9 @@ RUN apt-get update && apt-get install -y lsof software-properties-common python- |
54 | 54 | && chmod -R 755 /var/www/html \ |
55 | 55 | && printf "echo\n" >> /start.sh \ |
56 | 56 | && printf "echo \"================ Mtas -- Multi Tier Annotation Search =================\"\n" >> /start.sh \ |
57 | -&& printf "echo \" Timestamp 2016-12-15 07:39\"\n" >> /start.sh \ | |
57 | +&& printf "echo \" Timestamp 2016-12-16 11:24\"\n" >> /start.sh \ | |
58 | 58 | && printf "echo \" Lucene/Solr version 6.3.0\"\n" >> /start.sh \ |
59 | -&& printf "echo \" Mtas release 20161215\"\n" >> /start.sh \ | |
59 | +&& printf "echo \" Mtas release 20161216\"\n" >> /start.sh \ | |
60 | 60 | && printf "echo \" See https://meertensinstituut.github.io/mtas/ for more information\"\n" >> /start.sh \ |
61 | 61 | && printf "echo \"=======================================================================\"\n" >> /start.sh \ |
62 | 62 | && printf "echo\n" >> /start.sh \ |
... | ... |
pom.xml
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format> |
6 | 6 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
7 | 7 | <currentDevelopmentVersion>6.3.0</currentDevelopmentVersion> |
8 | - <currentDevelopmentRelease>20161215</currentDevelopmentRelease> | |
8 | + <currentDevelopmentRelease>20161216</currentDevelopmentRelease> | |
9 | 9 | </properties> |
10 | 10 | <modelVersion>4.0.0</modelVersion> |
11 | 11 | <groupId>dev.meertens.mtas</groupId> |
... | ... |
src/mtas/search/spans/MtasSpanContainingQuery.java
... | ... | @@ -2,7 +2,9 @@ package mtas.search.spans; |
2 | 2 | |
3 | 3 | import java.io.IOException; |
4 | 4 | |
5 | +import org.apache.lucene.index.IndexReader; | |
5 | 6 | import org.apache.lucene.search.IndexSearcher; |
7 | +import org.apache.lucene.search.Query; | |
6 | 8 | import org.apache.lucene.search.spans.SpanContainingQuery; |
7 | 9 | import org.apache.lucene.search.spans.SpanQuery; |
8 | 10 | import org.apache.lucene.search.spans.SpanWeight; |
... | ... | @@ -13,8 +15,8 @@ public class MtasSpanContainingQuery extends MtasSpanQuery { |
13 | 15 | /** The base query. */ |
14 | 16 | private SpanContainingQuery baseQuery; |
15 | 17 | |
16 | - public MtasSpanContainingQuery(SpanQuery q1, SpanQuery q2) { | |
17 | - super(); | |
18 | + public MtasSpanContainingQuery(MtasSpanQuery q1, MtasSpanQuery q2) { | |
19 | + super(); | |
18 | 20 | baseQuery = new SpanContainingQuery(q1, q2); |
19 | 21 | } |
20 | 22 | |
... | ... | @@ -35,6 +37,13 @@ public class MtasSpanContainingQuery extends MtasSpanQuery { |
35 | 37 | } |
36 | 38 | |
37 | 39 | @Override |
40 | + public MtasSpanQuery rewrite(IndexReader reader) throws IOException { | |
41 | + baseQuery = (SpanContainingQuery) baseQuery.rewrite(reader); | |
42 | + return this; | |
43 | + } | |
44 | + | |
45 | + | |
46 | + @Override | |
38 | 47 | public boolean equals(Object obj) { |
39 | 48 | if (this == obj) |
40 | 49 | return true; |
... | ... |
src/mtas/search/spans/MtasSpanEndQuery.java
src/mtas/search/spans/MtasSpanStartQuery.java
... | ... | @@ -21,7 +21,7 @@ import mtas.search.spans.util.MtasSpanQuery; |
21 | 21 | public class MtasSpanStartQuery extends MtasSpanQuery { |
22 | 22 | |
23 | 23 | /** The query. */ |
24 | - private SpanQuery query; | |
24 | + private MtasSpanQuery query; | |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Instantiates a new mtas span start query. |
... | ... | @@ -29,7 +29,7 @@ public class MtasSpanStartQuery extends MtasSpanQuery { |
29 | 29 | * @param query |
30 | 30 | * the query |
31 | 31 | */ |
32 | - public MtasSpanStartQuery(SpanQuery query) { | |
32 | + public MtasSpanStartQuery(MtasSpanQuery query) { | |
33 | 33 | super(); |
34 | 34 | this.query = query; |
35 | 35 | } |
... | ... | @@ -42,7 +42,7 @@ public class MtasSpanStartQuery extends MtasSpanQuery { |
42 | 42 | */ |
43 | 43 | @Override |
44 | 44 | public MtasSpanQuery rewrite(IndexReader reader) throws IOException { |
45 | - query.rewrite(reader); | |
45 | + query = query.rewrite(reader); | |
46 | 46 | return this; |
47 | 47 | } |
48 | 48 | |
... | ... |
src/mtas/search/spans/MtasSpanWithinQuery.java
... | ... | @@ -2,7 +2,9 @@ package mtas.search.spans; |
2 | 2 | |
3 | 3 | import java.io.IOException; |
4 | 4 | |
5 | +import org.apache.lucene.index.IndexReader; | |
5 | 6 | import org.apache.lucene.search.IndexSearcher; |
7 | +import org.apache.lucene.search.spans.SpanContainingQuery; | |
6 | 8 | import org.apache.lucene.search.spans.SpanQuery; |
7 | 9 | import org.apache.lucene.search.spans.SpanWeight; |
8 | 10 | import org.apache.lucene.search.spans.SpanWithinQuery; |
... | ... | @@ -18,6 +20,12 @@ public class MtasSpanWithinQuery extends MtasSpanQuery { |
18 | 20 | super(); |
19 | 21 | baseQuery = new SpanWithinQuery(q1, q2); |
20 | 22 | } |
23 | + | |
24 | + @Override | |
25 | + public MtasSpanQuery rewrite(IndexReader reader) throws IOException { | |
26 | + baseQuery = (SpanWithinQuery) baseQuery.rewrite(reader); | |
27 | + return this; | |
28 | + } | |
21 | 29 | |
22 | 30 | @Override |
23 | 31 | public String getField() { |
... | ... |
src/mtas/search/spans/util/MtasSpanQuery.java
src/site/markdown/search_query_stats_spans.md
... | ... | @@ -53,7 +53,7 @@ Again, the *key* is added to the response and may be used to distinguish between |
53 | 53 | 4. [Multiple](#multiple) : statistics on the occurrence of multiple words. |
54 | 54 | 5. [Prefix](#prefix) : default prefix for query |
55 | 55 | 5. [Ignore](#ignore) : query with ignore |
56 | -6. [Ignore and maximumIgnoreLength](#ignore-and-maximum-ignore-length) : query with ignore and maximumIgnoreLength | |
56 | +6. [Ignore and maximumIgnoreLength](#ignore-and-maximumignorelength) : query with ignore and maximumIgnoreLength | |
57 | 57 | 6. [Functions](#functions) : statistics using functions. |
58 | 58 | 7. [Multiple and Functions](#multiple-and-functions) : statistics using functions on the occurrence of multiple words. |
59 | 59 | |
... | ... | @@ -279,7 +279,7 @@ Total and average number of occurrences of an article followed by a noun, ignori |
279 | 279 | "errorNumber":691633}}}]}} |
280 | 280 | ``` |
281 | 281 | |
282 | -<a name="ignore-and-maximum-ignore-length"></a> | |
282 | +<a name="ignore-and-maximumignorelength"></a> | |
283 | 283 | |
284 | 284 | ### Ignore and maximumIgnoreLength |
285 | 285 | |
... | ... |