vallabh
(vallabh)
December 4, 2013, 9:31am
1
Dear All,
Can i use REPLACE function in elasticsearch query like mysql.
Mysql query:
select id,name from jos_artist_details where REPLACE(name, ' ', '')
= REPLACE('lady gaga',' ','');
Elastic search query:
$result = $es->search(array(
"query" => array(
"dis_max" => array(
"queries" => array(
0 => array(
"field" => array(
"name" => 'lady gaga'
)
)
)
)
),
"from" => 0,
"size" => 100000,
"sort" => array (
"_score"
)
)
);
Any suggestion is highly appreciated!!
Vallabh
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d0be8ab5-5759-4e32-a973-5733e72e0dbf%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
spinscale
(Alexander Reelsen)
December 4, 2013, 1:31pm
2
Hey,
you could use a script field for this, if you really need to. However this
might be quite a performance killer (like it is in SQL) - data manipulation
should be done at index time, not at query time.
See
Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.
--Alex
On Wed, Dec 4, 2013 at 10:31 AM, Vallabh Bothre vallabh.bothre@gmail.com wrote:
Dear All,
Can i use REPLACE function in elasticsearch query like mysql.
Mysql query:
select id,name from jos_artist_details where REPLACE(name, ' ', '')
= REPLACE('lady gaga',' ','');
Elastic search query:
$result = $es->search(array(
"query" => array(
"dis_max" => array(
"queries" => array(
0 => array(
"field" => array(
"name" => 'lady gaga'
)
)
)
)
),
"from" => 0,
"size" => 100000,
"sort" => array (
"_score"
)
)
);
Any suggestion is highly appreciated!!
Vallabh
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d0be8ab5-5759-4e32-a973-5733e72e0dbf%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out .
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9knXgHs6iJM1Ga_kQkHQkp2aKB3r5WR_Qqw2bvV3h8tg%40mail.gmail.com .
For more options, visit https://groups.google.com/groups/opt_out .
vallabh
(vallabh)
December 4, 2013, 2:07pm
3
Thanks Alex
On Wednesday, December 4, 2013 7:01:42 PM UTC+5:30, Alexander Reelsen wrote:
Hey,
you could use a script field for this, if you really need to. However this
might be quite a performance killer (like it is in SQL) - data manipulation
should be done at index time, not at query time.
See
Elasticsearch Platform — Find real-time answers at scale | Elastic
--Alex
On Wed, Dec 4, 2013 at 10:31 AM, Vallabh Bothre <vallabh...@gmail.com <javascript:>
wrote:
Dear All,
Can i use REPLACE function in elasticsearch query like mysql.
Mysql query:
select id,name from jos_artist_details where REPLACE(name, ' ', '')
= REPLACE('lady gaga',' ','');
Elastic search query:
$result = $es->search(array(
"query" => array(
"dis_max" => array(
"queries" => array(
0 => array(
"field" => array(
"name" => 'lady gaga'
)
)
)
)
),
"from" => 0,
"size" => 100000,
"sort" => array (
"_score"
)
)
);
Any suggestion is highly appreciated!!
Vallabh
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d0be8ab5-5759-4e32-a973-5733e72e0dbf%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out .
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0d4f9a6f-3f69-4095-bc3f-be4be80b5ebf%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .