dncrews / angular-elastic-builder Goto Github PK
View Code? Open in Web Editor NEWThis is an Angular.js directive for building an Elasticsearch query. You just give it the fields and can generate a query for it.
License: Other
This is an Angular.js directive for building an Elasticsearch query. You just give it the fields and can generate a query for it.
License: Other
Thanks for a great project.
The more I read up on the changes in the Query DSL post version 2.0 ... it seems like 'and', 'or', 'all' and 'any' .. are being de-emphasised if not being deprecated altogether in favour of compound queries that use 'must', 'must_not', and 'should' that are wrapped as 'bool' queries (like below).
Are there plans to handle these types of 'new-breed' queries in this tool?
@dncrews
When parsed into the builder, date fields from a query default to the current date with fixed format (calendar default format). Only some ISO formats are recognized
hihi @dncrews i have use your example to build query like that
{
"size": 10,
"filter": {
"and": [
{
"term": {
"appkey": "710659"
}
}
]
}
}
and i receive error when using https://github.com/elastic/elasticsearch-js
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [filter].",
"line": 1,
"col": 21
}
],
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [filter].",
"line": 1,
"col": 21
},
"status": 400
}
But when im modify the query like that, im fine
{
"query": {
"bool": {
"filter": [
{
"term": {
"appkey": "710569"
}
}
]
}
},
"size": 10
}
so you can suggest me how can fix that when using your project
setting $scope.elasticQueryBuilder.query and $scope.elasticQueryBuilder.needsUpdate = true does not work.
I changed file dist/angular-elastic-builder.js, line 478 from
prev[choice] = truthy === (~group[key][obj.field].indexOf(choice));
to
prev[choice] = truthy === (group[key][obj.field].indexOf(choice) >= 0);
to fix it.
Hi,
how to change the JSON output when the rule is set, I dont want to send filter, size while forming json.
just wanted it to be .
sample json should be
Get rules
{
"condition": "AND",
"rules": [
{
"id": "price",
"field": "price",
"type": "double",
"input": "text",
"operator": "less",
"value": "10.25"
},
{
"condition": "OR",
"rules": [
{
"id": "category",
"field": "category",
"type": "integer",
"input": "select",
"operator": "equal",
"value": "2"
},
{
"id": "category",
"field": "category",
"type": "integer",
"input": "select",
"operator": "equal",
"value": "1"
}
]
}
]
}
datepickerpopup isn't working now when select calendar.
http://prntscr.com/offhs9
For Example
Like term , I have a new variable i have to query
{
"size": 0,
"filter": {
"and": [{
"term": {
"status": "failed" // my own , can have multiple values (failed,passed,pending)
}
}]
}
}
If you don't put needsUpdate
, the filters array never gets created...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.