json-server icon indicating copy to clipboard operation
json-server copied to clipboard

Added the ability to full-text search for selected fields

Open RinatMullayanov opened this issue 7 years ago • 14 comments

Hello, I added the ability to full-text search for selected fields.

GET    /posts?q=search-text&attr=fieldName1,fieldName2,fieldName3,etc

When no field is specified, the search works as before.

RinatMullayanov avatar Jun 17 '17 10:06 RinatMullayanov

I'm very interested in this feature. Please, resolve this conflicts to add a reviewer

ronerjr avatar Jul 07 '17 14:07 ronerjr

@ronerjr I resolved the conflicts.

RinatMullayanov avatar Jul 07 '17 16:07 RinatMullayanov

@typicode let's ship it \o

ronerjr avatar Jul 07 '17 17:07 ronerjr

@typicode @ronerjr Will you accept my PR?

RinatMullayanov avatar Jul 18 '17 06:07 RinatMullayanov

@typicode @ronerjr Will you accept my PR?

RinatMullayanov avatar Aug 28 '17 05:08 RinatMullayanov

why was this never merged?

childonline avatar Apr 05 '18 14:04 childonline

i think it will be really useful feature

TerryJung avatar Sep 12 '18 04:09 TerryJung

bump

Earthii avatar Jan 09 '19 21:01 Earthii

it would be awesome to have this feature!

r03ert0 avatar May 08 '19 20:05 r03ert0

To utilize full-text search in the latest version of v1, you cannot use the syntax GET /posts?q=search-text. Please provide information on how to utilize full text search in the latest version.

GilSeonJu avatar Jan 31 '24 06:01 GilSeonJu

q query parameter is not working. http://localhost:3000/products?q=silver

PavanBashetty avatar Feb 28 '24 15:02 PavanBashetty

@PavanBashetty it doesn't work for me too if you take a look at the v1 documentation you will see that _like,_q, and pagination with limit have been deprecated

ubeysaab avatar Apr 12 '24 15:04 ubeysaab

If anyone wants to use the latest v0 with this feature, I implemented this pr on my fork https://github.com/notPlancha/json-server

notPlancha avatar Apr 14 '24 14:04 notPlancha

If you want to use the q query parameter which isn't working with latest version ([1.0.0-beta.0] Changing the version to "^0.17.4" and it worked.

varun-mfs avatar May 25 '24 10:05 varun-mfs