Comments (2)
Hi @paulcappadona,
Could you please elaborate? Can you give me an example?
Thanks!
from committer-elasticsearch.
Hi @kalhomoud
The method in question should be matching document metadata field names against a regex pattern, and if matching return true so that the committer processes the data as a JSON object (not a string).
The following code illustrates that the match method should be issued against the field, not the regex pattern
/**
* Attempting to match any fields beginning with "obj-" so they are treated as JSON objects
*/
public static void main(String[] args) {
String pattern = "^" + "obj-" + ".*$";
// Expected match result is true for the following
testField("obj-crawl-meta", pattern);
testField("obj-document-meta", pattern);
// Expected no match, so false
testField("somefield", pattern);
}
private static void testField(String field, String pattern) {
// this is the logic in the ElasticSearchCommitter
System.out.println("Matching (pattern.match(field)) pattern " + pattern + " against field " + field + " : Matched = " + pattern.matches(field));
// this is the correct logic
System.out.println("Matching (field.match(pattern)) field " + field + " against pattern " + pattern + " : Matched = " + field.matches(pattern));
}
The output of this code is
// Expected match (true)
Matching (pattern.match(field)) pattern ^obj-.$ against field obj-crawl-meta : Matched = false
Matching (field.match(pattern)) field obj-crawl-meta against pattern ^obj-.$ : Matched = true
Matching (pattern.match(field)) pattern ^obj-.$ against field obj-document-meta : Matched = false
Matching (field.match(pattern)) field obj-document-meta against pattern ^obj-.$ : Matched = true
// Expected fail (false)
Matching (pattern.match(field)) pattern ^obj-.$ against field somefield : Matched = false
Matching (field.match(pattern)) field somefield against pattern ^obj-.$ : Matched = false
Regards
Paul
from committer-elasticsearch.
Related Issues (20)
- id is too long, must be no longer than 512 bytes but was: 520 HOT 14
- No error for connecting to elasticsearch even though elasticsearch service is stopped? HOT 3
- Committer for AWS Elastic Search HOT 4
- Feature request - provide refresh and wait for active shards as configurables
- pipeline parameter for Elasticsearch 5+ HOT 2
- Message: listener timeout after waiting for [30000] ms HOT 1
- Narconix Collecttor is not committed to Elastic search.
- Naroconix have any one used for siteminder url what additional setting is required? HOT 1
- Caused by: java.lang.IllegalArgumentException: Negative buffer size HOT 1
- Not able to commit the processed items to Elastic search using norconex file system collector HOT 1
- <typeName> should be set to not requried HOT 2
- Remove warning “Specifying types in bulk requests is deprecated.” HOT 2
- Deletion not working when a non "document.reference" value is used HOT 2
- Removal of mapping types HOT 1
- Committer closed without sending any documents HOT 1
- ElasticSearch Committer Error HOT 14
- WARN - unknown role HOT 2
- Feature request - support secure elasticsearch apikeys index
- utf-8 unicode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from committer-elasticsearch.