Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
d528d275
Commit
d528d275
authored
5 years ago
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3510: Enable quick-search and suggestions on entity labels
parent
dca71ddf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
SolrIndexHelper.java
...va/org/apache/atlas/repository/graph/SolrIndexHelper.java
+7
-1
EntityGraphRetriever.java
...atlas/repository/store/graph/v2/EntityGraphRetriever.java
+1
-0
No files found.
repository/src/main/java/org/apache/atlas/repository/graph/SolrIndexHelper.java
View file @
d528d275
...
...
@@ -36,6 +36,8 @@ import java.util.*;
import
static
org
.
apache
.
atlas
.
model
.
typedef
.
AtlasStructDef
.
AtlasAttributeDef
.
DEFAULT_SEARCHWEIGHT
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
CLASSIFICATION_TEXT_KEY
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
CUSTOM_ATTRIBUTES_PROPERTY_KEY
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
LABELS_PROPERTY_KEY
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
TYPE_NAME_PROPERTY_KEY
;
/**
...
...
@@ -48,6 +50,8 @@ public class SolrIndexHelper implements IndexChangeListener {
public
static
final
int
DEFAULT_SEARCHWEIGHT_FOR_STRINGS
=
3
;
public
static
final
int
SEARCHWEIGHT_FOR_CLASSIFICATIONS
=
10
;
public
static
final
int
SEARCHWEIGHT_FOR_LABELS
=
10
;
public
static
final
int
SEARCHWEIGHT_FOR_CUSTOM_ATTRS
=
3
;
public
static
final
int
SEARCHWEIGHT_FOR_TYPENAME
=
1
;
private
static
final
int
MIN_SEARCH_WEIGHT_FOR_SUGGESTIONS
=
8
;
...
...
@@ -116,10 +120,12 @@ public class SolrIndexHelper implements IndexChangeListener {
Map
<
String
,
Integer
>
ret
=
new
HashMap
<>();
Collection
<
AtlasEntityType
>
entityTypes
=
typeRegistry
.
getAllEntityTypes
();
//the following
two
properties are specially added manually.
//the following properties are specially added manually.
//as, they don't come in the entity definitions as attributes.
ret
.
put
(
typeRegistry
.
getIndexFieldName
(
CLASSIFICATION_TEXT_KEY
),
SEARCHWEIGHT_FOR_CLASSIFICATIONS
);
ret
.
put
(
typeRegistry
.
getIndexFieldName
(
LABELS_PROPERTY_KEY
),
SEARCHWEIGHT_FOR_LABELS
);
ret
.
put
(
typeRegistry
.
getIndexFieldName
(
CUSTOM_ATTRIBUTES_PROPERTY_KEY
),
SEARCHWEIGHT_FOR_CUSTOM_ATTRS
);
ret
.
put
(
typeRegistry
.
getIndexFieldName
(
TYPE_NAME_PROPERTY_KEY
),
SEARCHWEIGHT_FOR_TYPENAME
);
if
(!
CollectionUtils
.
isNotEmpty
(
entityTypes
))
{
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
View file @
d528d275
...
...
@@ -501,6 +501,7 @@ public class EntityGraphRetriever {
ret
.
setStatus
(
GraphHelper
.
getStatus
(
entityVertex
));
ret
.
setClassificationNames
(
getAllTraitNames
(
entityVertex
));
ret
.
setIsIncomplete
(
isIncomplete
);
ret
.
setLabels
(
getLabels
(
entityVertex
));
List
<
AtlasTermAssignmentHeader
>
termAssignmentHeaders
=
mapAssignedTerms
(
entityVertex
);
ret
.
setMeanings
(
termAssignmentHeaders
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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