New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement span queries #304

Open
munkie opened this Issue Jan 17, 2013 · 6 comments

Comments

Projects
None yet
3 participants
@ruflin

This comment has been minimized.

Show comment
Hide comment
@ruflin

ruflin Jan 20, 2013

Owner

Looks like all these queries are quite different. This means, every query will have its own implementation?

Owner

ruflin commented Jan 20, 2013

Looks like all these queries are quite different. This means, every query will have its own implementation?

@munkie

This comment has been minimized.

Show comment
Hide comment
@munkie

munkie Jan 20, 2013

Contributor

Yes, every query should be implemented as it own class.
Mainly i created this issue not to forget to implemented missing queries.

Contributor

munkie commented Jan 20, 2013

Yes, every query should be implemented as it own class.
Mainly i created this issue not to forget to implemented missing queries.

@munkie

This comment has been minimized.

Show comment
Hide comment
@munkie

munkie Jan 20, 2013

Contributor

Maybe it's better to create issue with all missing filters and queries?

Contributor

munkie commented Jan 20, 2013

Maybe it's better to create issue with all missing filters and queries?

@ruflin

This comment has been minimized.

Show comment
Hide comment
@ruflin

ruflin Jan 21, 2013

Owner

I would do it one by one. Otherwise the issue is too big to be implemented at once and I also prefer small pull requests.

Owner

ruflin commented Jan 21, 2013

I would do it one by one. Otherwise the issue is too big to be implemented at once and I also prefer small pull requests.

@svandenborne

This comment has been minimized.

Show comment
Hide comment
@svandenborne

svandenborne Jul 17, 2013

Is there already some progress on this? I don't need it urgently but it would be nice to have it in a future release. For now I created the query array myself like:

$inner_span_near = array();
$span_near = array();

$inner_span_term1['span_term'] = array("file" => $term1);
$inner_span_term2['span_term'] = array("file" => $term2);;
$inner_terms = array($inner_span_term1,$inner_span_term2);

$inner_span_near['clauses'] = $inner_terms;
$inner_span_near['slop'] = 0;
$inner_span_near['in_order'] = false;
$inner_span_near['collect_payloads'] = false;

$clauses = array('span_near' => $inner_span_near);
$span_term1 = array('span_term' => array("file" => $term3));
$span_term2 = array('span_term' => array("file" => $term4));

$clauses2 = array();
$clauses2[] = $clauses;
$clauses2[] = $span_term1;
$clauses2[] = $span_term2;

$span_near['clauses'] = $clauses2;
$span_near['slop'] = 12;
$span_near['in_order'] = false;
$span_near['collect_payloads'] = false;

$query = array('span_near' => $span_near);

$params = array('query' => $query);

wich gives me:

{
"query": {
"span_near": {
"clauses": [
{
"span_near": {
"clauses": [
{
"span_term": {
"file": "term1"
}
},
{
"span_term": {
"file": "term2"
}
}
],
"slop": 0,
"in_order": false,
"collect_payloads": false
}
},
{
"span_term": {
"file": "term3"
}
},
{
"span_term": {
"file": "term4"
}
}
],
"slop": 12,
"in_order": false,
"collect_payloads": false
}
}
}

svandenborne commented Jul 17, 2013

Is there already some progress on this? I don't need it urgently but it would be nice to have it in a future release. For now I created the query array myself like:

$inner_span_near = array();
$span_near = array();

$inner_span_term1['span_term'] = array("file" => $term1);
$inner_span_term2['span_term'] = array("file" => $term2);;
$inner_terms = array($inner_span_term1,$inner_span_term2);

$inner_span_near['clauses'] = $inner_terms;
$inner_span_near['slop'] = 0;
$inner_span_near['in_order'] = false;
$inner_span_near['collect_payloads'] = false;

$clauses = array('span_near' => $inner_span_near);
$span_term1 = array('span_term' => array("file" => $term3));
$span_term2 = array('span_term' => array("file" => $term4));

$clauses2 = array();
$clauses2[] = $clauses;
$clauses2[] = $span_term1;
$clauses2[] = $span_term2;

$span_near['clauses'] = $clauses2;
$span_near['slop'] = 12;
$span_near['in_order'] = false;
$span_near['collect_payloads'] = false;

$query = array('span_near' => $span_near);

$params = array('query' => $query);

wich gives me:

{
"query": {
"span_near": {
"clauses": [
{
"span_near": {
"clauses": [
{
"span_term": {
"file": "term1"
}
},
{
"span_term": {
"file": "term2"
}
}
],
"slop": 0,
"in_order": false,
"collect_payloads": false
}
},
{
"span_term": {
"file": "term3"
}
},
{
"span_term": {
"file": "term4"
}
}
],
"slop": 12,
"in_order": false,
"collect_payloads": false
}
}
}

@ruflin

This comment has been minimized.

Show comment
Hide comment
@ruflin

ruflin Jul 17, 2013

Owner

As far as I know, there is no progress here. It would be nice if you could push it forward so we have it in the next release.

Owner

ruflin commented Jul 17, 2013

As far as I know, there is no progress here. It would be nice if you could push it forward so we have it in the next release.

@ruflin ruflin added the enhancement label Dec 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment