# Fulltext search issue

**URL:** <https://community.prismic.io/t/fulltext-search-issue/1406>\
**Category:** Developing with Prismic\
**Tags:** php\
**Created:** [July 31, 2020, 4:16pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406 "2020-07-31T16:16:23Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrmpham](https://avatars.discourse-cdn.com/v4/letter/l/a183cd/32.png) [@lrmpham](https://community.prismic.io/u/lrmpham)\
**Post date:** [July 31, 2020, 4:16pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/1 "2020-07-31T16:16:23Z")

</div>

Hi,

Here is my fulltext query - $response = $api-\>query(  
Predicates::fulltext('document', 'museum')  
);

Only 3 results come back although there are many documents of type press\_releases that has museum in their title. Please advise.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [July 31, 2020, 6:38pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/2 "2020-07-31T18:38:30Z")

</div>

Hello @lrmpham!

With that predicate, you’re searching results in all documents. Maybe a specific search in just that Custom type (press\_releases) and in a specific field would be more useful?

```auto
[fulltext(my.press_releases.title, "museum")] // specific field

```

[Read the full reference about the Fulltext search.](https://prismic.io/docs/rest-api/query-the-api/predicates-reference#42_0-fulltext)

---

<div class="post-metadata">

**Author:** ![lrmpham](https://avatars.discourse-cdn.com/v4/letter/l/a183cd/32.png) [@lrmpham](https://community.prismic.io/u/lrmpham)\
**Post date:** [July 31, 2020, 7:22pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/3 "2020-07-31T19:22:12Z")

</div>

That would work, but I need to search in all documents. This will be used for the search bar on my website to allow the user to search the entire site for something.

---

<div class="post-metadata">

**Author:** ![lrmpham](https://avatars.discourse-cdn.com/v4/letter/l/a183cd/32.png) [@lrmpham](https://community.prismic.io/u/lrmpham)\
**Post date:** [July 31, 2020, 7:36pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/4 "2020-07-31T19:36:40Z")

</div>

I tried your suggestion and it still doesn’t bring back anything. I also tried this:  
$response = $api-\>query(  
[ Predicates::at(‘document.type’, ‘press\_releases’),  
Predicates::fulltext(‘document’, $term) ]  
);  
and still no results.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [August 3, 2020, 11:18am UTC](https://community.prismic.io/t/fulltext-search-issue/1406/5 "2020-08-03T11:18:38Z")

</div>

Hey,

Can you tell us what kind of fields the other search terms are in? Like a group or a key text field etc.

Thanks.

---

<div class="post-metadata">

**Author:** ![lrmpham](https://avatars.discourse-cdn.com/v4/letter/l/a183cd/32.png) [@lrmpham](https://community.prismic.io/u/lrmpham)\
**Post date:** [August 3, 2020, 3:45pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/6 "2020-08-03T15:45:30Z")

</div>

The field is a simple Title field. I tried what was suggested:  
$response = $api-\>query(  
[Predicates::fulltext(‘my.press\_releases.page\_title’, ‘museum’)]  
);  
and no documents comes back.  
If I try:  
$response = $api-\>query(  
[Predicates::fulltext(‘document’, ‘museum’)]  
);  
only 2 documents comes back.  
There are at least 50+ documents with museum in the page\_title field.  
This seems like a simple search but nothing comes back.  
Do you have access to my repo to do testing yourself ?

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [August 3, 2020, 3:51pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/7 "2020-08-03T15:51:21Z")

</div>

You can send a private message with the name of your repo to the [@Prismic-Support-Team](https://community.prismic.io/groups/prismic-support-team) so we can check it.

---

<div class="post-metadata">

**Author:** ![lrmpham](https://avatars.discourse-cdn.com/v4/letter/l/a183cd/32.png) [@lrmpham](https://community.prismic.io/u/lrmpham)\
**Post date:** [August 3, 2020, 4:12pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/8 "2020-08-03T16:12:44Z")

</div>

Haven’t done this before, but how do I private message you ? 🙂

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [August 3, 2020, 4:14pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/9 "2020-08-03T16:14:32Z")

</div>

Click my profile image and then the message button.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [August 4, 2020, 12:59am UTC](https://community.prismic.io/t/fulltext-search-issue/1406/11 "2020-08-04T00:59:49Z")

</div>

The syntax may vary depending on the technology you are using to query, which one are you using?

I have tested the following query in your endpoint and it returns 90 documents:

`[fulltext(my.press_releases.page_title, "museum")]`

You can also test this by going to your API endpoint: [https://your-repo-name.prismic.io/api/v2](https://your-repo-name.prismic.io/api/v2)

---

<div class="post-metadata">

**Author:** ![lrmpham](https://avatars.discourse-cdn.com/v4/letter/l/a183cd/32.png) [@lrmpham](https://community.prismic.io/u/lrmpham)\
**Post date:** [August 4, 2020, 4:33am UTC](https://community.prismic.io/t/fulltext-search-issue/1406/12 "2020-08-04T04:33:14Z")

</div>

Yes, I noticed that results are coming back now so whatever you guys did worked ! Thanks.  
When I did a query of all documents, the first one that came back was the Plan Your Visit page. Is it possible the configure the search to put documents with the search term in the Title at the top of the search results ? Thanks.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [September 24, 2020, 1:51am UTC](https://community.prismic.io/t/fulltext-search-issue/1406/14 "2020-09-24T01:51:52Z")

</div>

This issue has been closed due to inactivity.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:29pm UTC](https://community.prismic.io/t/fulltext-search-issue/1406/15 "2021-12-09T17:29:48Z")

</div>


