in postgres i used " SELECT url FROM links WHERE ? like url || '%' " or SQL server " SELECT url FROM links WHERE @url like url + '%' ", so how possibly can achieve that using elasticsearch
You could do it with a regex query. It'd probably be faster than a script query because a script query has to be run for all the documents. If you can write a term query on the domain part and then use a script query to recheck the condition you might get good performance by combining both in the must clause of a bool query. Might. It is worth trying both. I suspect the regex will be better but I can't be sure without trying it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.