I’m trying to search journal Articles by blueprint it works if I search by full word not partially like
curl --location --request POST 'http://localhost:8080/o/search/v1.0/search?fields=embedded&nestedFields=embedded&restrictFields=actions&search=facebook' \
--header 'x-csrf-token: aQr8DzcP' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0MQ==' \
--data-raw '{
"attributes": {
"search.experiences.blueprint.external.reference.code": "global-search",
"search.empty.search": true
}
}'
If I search by “facebook” it works since I created a web content with title = facebook . but when I search by “face” return empty result .
this is my blueprint below
is there any way to solve this issue ? and I need a way to implement it by code not by liferay api since I need to customize the response .
Hello @AhmadQasem,
The behavior you are observing is expected because you are utilizing ‘Filter by Exact Terms Match’ blueprint element, which will return documents that contain one or more exact terms in a provided field.
However, based on your requirement, it appears you require a prefix match, and for this, you might need to use Text Match Over Multiple Fields blueprint element.
Official Documentation: Search Blueprints Elements Reference - Liferay Official Documentation - Liferay Learn
Have you solved this yet, Ahmad? I think you’re looking at the wrong issue, because none of the elements in that blueprint you showed will affect the full text searching of the title field. Here’s my working example:
Edit to add; this api call works for me, as well:
curl --location --request POST 'http://localhost:8080/o/search/v1.0/search?search=face' --user 'test@liferay.com:learn' --header 'Content-Type: application/json' --data-raw '{
"attributes": {
"search.experiences.blueprint.external.reference.code": "facebook-searcher",
"search.empty.search": true
}
}'