Skip to content
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

Closed
munkie opened this issue Jan 17, 2013 · 6 comments
Closed

Implement span queries #304

munkie opened this issue Jan 17, 2013 · 6 comments

Comments

@ruflin
Copy link
Owner

ruflin commented Jan 20, 2013

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

@munkie
Copy link
Contributor Author

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
Copy link
Contributor Author

munkie commented Jan 20, 2013

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

@ruflin
Copy link
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
Copy link

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
Copy link
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.

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

No branches or pull requests

4 participants