Skip to content

Commit

Permalink
[services] Make defining a filter easier.
Browse files Browse the repository at this point in the history
  • Loading branch information
bambi42 committed Apr 15, 2021
1 parent d6ee6aa commit db12639
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ class Book

<!-- Optionally you can configure the parameter name (default="ts_query") for the for the API,
the config string (default="'english'") used by Postgres for text search and if the column you
are searching is already vectorized (default=false).
YOU HAVE TO DEFINE THOSE PARAMETERS IN THIS ORDER AND YOU ALWAYS HAVE TO DEFINE ALL PREVIOUS ONES! -->
are searching is already vectorized (default=false). -->
<argument key="$textSearchParameterName" type="string">postgres_text_search</argument>
<argument key="$postgresTsConfigString" type="string">'german'</argument>
<argument key="$preVectorized">true</argument>
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<argument type="service" id="doctrine" />
<argument type="service" id="logger" on-invalid="ignore" />
<argument key="$nameConverter" type="service" id="api_platform.name_converter" on-invalid="ignore" />
<argument key="$textSearchParameterName" type="string">ts_query</argument>
<argument key="$postgresTsConfigString" type="string">'english'</argument>
<argument key="$preVectorized">false</argument>
</service>
<service id="Bambi\PostgresTextSearchBundle\ApiPlatform\Filter\TextSearchMatchFilter"
alias="bambi_postgres_text_search.filter.text_search_match_filter"/>
Expand Down

0 comments on commit db12639

Please sign in to comment.