Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lucene
Project
Project
Details
Activity
Releases
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
mohamad.alturky
lucene
Commits
337e7fee
Commit
337e7fee
authored
Mar 25, 2024
by
mohamad.alturky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit representers resolver
parent
a4ec0586
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
8 deletions
+19
-8
DocumentToStringRepresenterResolver.java
...senters/resolver/DocumentToStringRepresenterResolver.java
+12
-5
IDocumentRepresenterResolver.java
...s/representers/resolver/IDocumentRepresenterResolver.java
+7
-0
LuceneEngineBuilder.java
...e/engine/builder/implementations/LuceneEngineBuilder.java
+0
-2
LuceneEngine.java
...om/search/lucene/engine/implementations/LuceneEngine.java
+0
-1
No files found.
src/main/java/com/search/lucene/documents/representers/resolver/DocumentToStringRepresenterResolver.java
View file @
337e7fee
package
com
.
search
.
lucene
.
documents
.
representers
.
resolver
;
package
com
.
search
.
lucene
.
documents
.
representers
.
resolver
;
import
com.search.lucene.documents.representers.abstractions.IDocumentRepresenter
;
import
com.search.lucene.documents.representers.abstractions.IDocumentRepresenter
;
import
com.search.lucene.documents.representers.implementations.CSVDocumentStringRepresenter
;
import
com.search.lucene.documents.representers.implementations.PDFDocumentStringRepresenter
;
import
com.search.lucene.documents.representers.implementations.TextDocumentStringRepresenter
;
import
com.search.lucene.settings.RepresentationSchema
;
import
com.search.lucene.settings.RepresentationSchema
;
import
org.apache.lucene.document.Document
;
import
org.apache.lucene.document.Document
;
import
java.util.HashMap
;
import
java.util.HashMap
;
public
class
DocumentRepresenterResolver
<
T
>
{
public
class
DocumentToStringRepresenterResolver
implements
IDocumentRepresenterResolver
<
String
>{
private
final
HashMap
<
String
,
IDocumentRepresenter
<
T
>>
hashMap
;
private
final
HashMap
<
String
,
IDocumentRepresenter
<
String
>>
hashMap
;
public
DocumentToStringRepresenterResolver
()
{
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
RepresentationSchema
.
CSV
,
new
CSVDocumentStringRepresenter
());
hashMap
.
put
(
RepresentationSchema
.
TEXT
,
new
TextDocumentStringRepresenter
());
hashMap
.
put
(
RepresentationSchema
.
PDF
,
new
PDFDocumentStringRepresenter
());
public
DocumentRepresenterResolver
(
HashMap
<
String
,
IDocumentRepresenter
<
T
>>
hashMap
)
{
this
.
hashMap
=
hashMap
;
}
}
public
T
resolveRepresentation
(
Document
document
)
{
public
String
resolveRepresentation
(
Document
document
)
{
return
hashMap
.
get
(
document
.
get
(
RepresentationSchema
.
TYPE
)).
Represent
(
document
);
return
hashMap
.
get
(
document
.
get
(
RepresentationSchema
.
TYPE
)).
Represent
(
document
);
}
}
}
}
src/main/java/com/search/lucene/documents/representers/resolver/IDocumentRepresenterResolver.java
0 → 100644
View file @
337e7fee
package
com
.
search
.
lucene
.
documents
.
representers
.
resolver
;
import
org.apache.lucene.document.Document
;
public
interface
IDocumentRepresenterResolver
<
T
>
{
T
resolveRepresentation
(
Document
document
);
}
src/main/java/com/search/lucene/engine/builder/implementations/LuceneEngineBuilder.java
View file @
337e7fee
package
com
.
search
.
lucene
.
engine
.
builder
.
implementations
;
package
com
.
search
.
lucene
.
engine
.
builder
.
implementations
;
import
com.search.lucene.documents.representers.resolver.DocumentRepresenterResolver
;
import
com.search.lucene.engine.abstractions.ISearchEngine
;
import
com.search.lucene.engine.abstractions.ISearchEngine
;
import
com.search.lucene.engine.builder.abstractions.IEngineBuilder
;
import
com.search.lucene.engine.builder.abstractions.IEngineBuilder
;
import
com.search.lucene.engine.implementations.LuceneEngine
;
import
com.search.lucene.engine.implementations.LuceneEngine
;
...
@@ -16,7 +15,6 @@ import com.search.lucene.settings.IndexPaths;
...
@@ -16,7 +15,6 @@ import com.search.lucene.settings.IndexPaths;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
public
class
LuceneEngineBuilder
implements
IEngineBuilder
{
public
class
LuceneEngineBuilder
implements
IEngineBuilder
{
@Override
@Override
...
...
src/main/java/com/search/lucene/engine/implementations/LuceneEngine.java
View file @
337e7fee
package
com
.
search
.
lucene
.
engine
.
implementations
;
package
com
.
search
.
lucene
.
engine
.
implementations
;
import
com.search.lucene.documents.representers.resolver.DocumentRepresenterResolver
;
import
com.search.lucene.engine.abstractions.ISearchEngine
;
import
com.search.lucene.engine.abstractions.ISearchEngine
;
import
com.search.lucene.indexers.abstractions.IFileIndexer
;
import
com.search.lucene.indexers.abstractions.IFileIndexer
;
import
com.search.lucene.searchers.abstractions.ISearcher
;
import
com.search.lucene.searchers.abstractions.ISearcher
;
...
...
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