Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DARIAH-DE Aggregator Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DARIAH-DE
DARIAH-DE Aggregator Services
Commits
524bbf96
Commit
524bbf96
authored
7 years ago
by
Thorsten Vitt
Browse files
Options
Downloads
Patches
Plain Diff
Don't forget to pass through filter to search
Refs #22310
parent
63d46181
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/info/textgrid/services/aggregator/SearchResultList.java
+8
-3
8 additions, 3 deletions
...a/info/textgrid/services/aggregator/SearchResultList.java
with
8 additions
and
3 deletions
src/main/java/info/textgrid/services/aggregator/SearchResultList.java
+
8
−
3
View file @
524bbf96
...
...
@@ -12,6 +12,7 @@
import
info.textgrid.namespaces.middleware.tgsearch.Response
;
import
info.textgrid.namespaces.middleware.tgsearch.ResultType
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.ForwardingCollection
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.UnmodifiableIterator
;
...
...
@@ -58,11 +59,12 @@ public boolean hasNext() {
private
int
hits
=
-
1
;
// # of hits, -1 if we don't know yet
private
int
nextStart
=
0
;
//
private
int
stop
=
Integer
.
MAX_VALUE
;
private
SearchClient
searchClient
;
private
final
SearchClient
searchClient
;
protected
SearchResultList
(
final
SearchClient
client
,
final
String
query
,
final
String
target
,
List
<
String
>
filter
,
boolean
sandbox
)
{
this
.
searchClient
=
client
;
this
.
query
=
query
;
this
.
filter
=
filter
;
client
.
setTarget
(
target
);
client
.
setSandbox
(
sandbox
);
}
...
...
@@ -103,9 +105,9 @@ public int size() {
private
Logger
logger
=
Logger
.
getLogger
(
getClass
().
getCanonicalName
());
private
String
query
;
private
final
String
query
;
private
List
<
String
>
filter
;
private
final
List
<
String
>
filter
;
@Override
...
...
@@ -139,10 +141,13 @@ protected Collection<ObjectType> delegate() {
protected
void
fetchNextChunk
()
{
if
(
finished
)
return
;
Response
response
=
searchClient
.
query
(
query
,
null
,
""
,
nextStart
,
Math
.
min
(
stop
-
nextStart
,
chunkSize
),
filter
);
hits
=
Integer
.
parseInt
(
response
.
getHits
());
logger
.
info
(
MessageFormat
.
format
(
"Next query for {0}, filters {3}, sandbox {1}, {2} hits"
,
query
,
searchClient
.
getSandbox
(),
hits
,
Joiner
.
on
(
"; "
).
join
(
filter
)));
if
(!
started
)
{
availableResults
=
Lists
.
newArrayListWithExpectedSize
(
hits
);
started
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment