Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Neo4jsource
Commits
4bbf2b54
Commit
4bbf2b54
authored
9 years ago
by
lutovich
Browse files
Options
Download
Email Patches
Plain Diff
Fixed reading of non-unique index fields during sampling
parent
53c05895
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/schema/sampler/NonUniqueLuceneIndexSampler.java
+9
-5
.../api/impl/schema/sampler/NonUniqueLuceneIndexSampler.java
with
9 additions
and
5 deletions
+9
-5
community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/schema/sampler/NonUniqueLuceneIndexSampler.java
+
9
-
5
View file @
4bbf2b54
...
...
@@ -27,18 +27,16 @@ import org.apache.lucene.search.IndexSearcher;
import
org.apache.lucene.util.BytesRef
;
import
java.io.IOException
;
import
java.util.HashSet
;
import
java.util.Set
;
import
org.neo4j.helpers.TaskControl
;
import
org.neo4j.helpers.collection.Iterables
;
import
org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException
;
import
org.neo4j.kernel.api.impl.schema.LuceneDocumentStructure
;
import
org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig
;
import
org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler
;
import
org.neo4j.register.Register
;
import
static
org
.
neo4j
.
kernel
.
api
.
impl
.
schema
.
LuceneDocumentStructure
.
NODE_ID_KEY
;
/**
* Sampler for non-unique Lucene schema index.
* Internally uses terms and their document frequencies for sampling.
...
...
@@ -92,8 +90,14 @@ public class NonUniqueLuceneIndexSampler extends LuceneIndexSampler
private
static
Set
<
String
>
getFieldNamesToSample
(
LeafReaderContext
readerContext
)
throws
IOException
{
Fields
fields
=
readerContext
.
reader
().
fields
();
Set
<
String
>
fieldNames
=
Iterables
.
toSet
(
fields
);
assert
fieldNames
.
remove
(
NODE_ID_KEY
);
Set
<
String
>
fieldNames
=
new
HashSet
<>();
for
(
String
field
:
fields
)
{
if
(
!
LuceneDocumentStructure
.
NODE_ID_KEY
.
equals
(
field
)
)
{
fieldNames
.
add
(
field
);
}
}
return
fieldNames
;
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help