circleci
11 of 605 relevant lines covered (1.82%)
0.02 hits per line
1 |
class SearchBuilder |
× |
2 |
class JoinChildrenQuery |
× |
3 |
attr_reader :parent_query
|
× |
4 |
def initialize(parent_query) |
× |
5 |
@parent_query = parent_query
|
× |
6 |
end
|
× |
7 |
|
× |
8 |
def to_s |
× |
9 |
q = queries.map do |query|
|
× |
10 |
"(#{dismax_join(send(query))})"
|
× |
11 |
end.join(" OR ") |
× |
12 |
"{!lucene}#{q}"
|
× |
13 |
end
|
× |
14 |
|
× |
15 |
private |
× |
16 |
|
× |
17 |
def queries |
× |
18 |
[ |
× |
19 |
:main_query,
|
× |
20 |
:query_children
|
× |
21 |
] |
× |
22 |
end
|
× |
23 |
|
× |
24 |
def dismax_join(query) |
× |
25 |
"#{query}{!dismax}#{parent_query}"
|
× |
26 |
end
|
× |
27 |
|
× |
28 |
def main_query |
× |
29 |
""
|
× |
30 |
end
|
× |
31 |
|
× |
32 |
def query_children |
× |
33 |
"{!join from=collection_id_ssim to=id}"
|
× |
34 |
end
|
× |
35 |
end
|
× |
36 |
end
|
× |