# Custom filer to extract some phrases

**URL:** <https://discuss.elastic.co/t/custom-filer-to-extract-some-phrases/13160>\
**Category:** Elasticsearch\
**Created:** [August 10, 2013, 7:30am UTC](https://discuss.elastic.co/t/custom-filer-to-extract-some-phrases/13160 "2013-08-10T07:30:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faillissements\_Dossi](https://avatars.discourse-cdn.com/v4/letter/f/ea666f/32.png) [@Faillissements\_Dossi](https://discuss.elastic.co/u/Faillissements_Dossi)\
**Post date:** [August 10, 2013, 7:30am UTC](https://discuss.elastic.co/t/custom-filer-to-extract-some-phrases/13160/1 "2013-08-10T07:30:59Z")

</div>

Hi,

I would like to build a custom analyzer to extract only specific phrases  
from a text.

text:  
"te vermeerderen met 8% vakantietoeslag en een dertiende maand zolang als  
het dienstverband voortduurt en voorts tot betaling van de wettelijke boete  
ex artikel 7:625 BW over de inmiddels verschenen loontermijnen en tot  
betaling van de wettelijke rente vanaf de, naar het hof begrijpt, vervaldag  
van iedere afzonderlijke loontermijn ex artikel 7:623 BW, althans"

Result shoud be: "artikel 7:625 BW" and " artikel 7:623 BW"

The syntax for the analyzer is:  
"pattern": "(art.\*?BW)",  
"type": "pattern"

But in stead of the two phrases it returns all the text except the phrase,  
using the phrases as delimiter.

Wat do I need to do to get only the two phrases returned for this analyzer?

Thanks, Marcel

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [August 12, 2013, 5:52pm UTC](https://discuss.elastic.co/t/custom-filer-to-extract-some-phrases/13160/2 "2013-08-12T17:52:29Z")

</div>

Marcel,

Perhaps this would help?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> 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.

Brian

On Saturday, August 10, 2013 3:30:59 AM UTC-4, Faillissements Dossier wrote:

> Hi,
> 
> I would like to build a custom analyzer to extract only specific phrases  
> from a text.
> 
> text:  
> "te vermeerderen met 8% vakantietoeslag en een dertiende maand zolang als  
> het dienstverband voortduurt en voorts tot betaling van de wettelijke boete  
> ex artikel 7:625 BW over de inmiddels verschenen loontermijnen en tot  
> betaling van de wettelijke rente vanaf de, naar het hof begrijpt, vervaldag  
> van iedere afzonderlijke loontermijn ex artikel 7:623 BW, althans"
> 
> Result shoud be: "artikel 7:625 BW" and " artikel 7:623 BW"
> 
> The syntax for the analyzer is:  
> "pattern": "(art.\*?BW)",  
> "type": "pattern"
> 
> But in stead of the two phrases it returns all the text except the phrase,  
> using the phrases as delimiter.
> 
> Wat do I need to do to get only the two phrases returned for this analyzer?
> 
> Thanks, Marcel

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:21am UTC](https://discuss.elastic.co/t/custom-filer-to-extract-some-phrases/13160/3 "2017-07-06T02:21:30Z")

</div>


