Git Product home page Git Product logo

Comments (4)

mrkamel avatar mrkamel commented on September 21, 2024

hi, thanks for reporting. brackets are operators in search cop. Try to put it in quotes:

title:"title with ( brackets"

from search_cop.

ttekesuke avatar ttekesuke commented on September 21, 2024

Thank you. I could search ( with quotes.
BTW, if there are space characters in the search string, if the search string is not enclosed in quotes,
a query will be issued that connects a group of strings divided by spaces with the AND condition.

SELECT * FROM "items" WHERE (
    (("items"."title" IS NOT NULL AND "items"."title" ILIKE '%title%') OR ("items"."sub_title" IS NOT NULL AND "items"."sub_title" ILIKE '%title%')) AND 
    (("items"."title" IS NOT NULL AND "items"."title" ILIKE '%with%') OR ("items"."sub_title" IS NOT NULL AND "items"."sub_title" ILIKE '%with%')) AND 
    (("items"."title" IS NOT NULL AND "items"."title" ILIKE '%brackets%') OR ("items"."sub_title" IS NOT NULL AND "items"."sub_title" ILIKE '%brackets%'))
)

However, if I enclose the search string in quotes, it seems that the spaces are also considered as strings
and are searched as a single chunk.

SELECT * "items" WHERE (
    (("items"."title" IS NOT NULL AND "items"."title" ILIKE '%title with brackets%') OR ("items"."sub_title" IS NOT NULL AND "items"."sub_title" ILIKE '%title with brackets%'))
)

Is there any way to connect strings with spaces with the AND condition and also search for bracket strings?

from search_cop.

mrkamel avatar mrkamel commented on September 21, 2024

That's not possible atm, sry. Search cop orients on fulltext engines. The quotes are also an operator and try to match a field exactly. Adding an escaping feature (title:some\(word) would maybe help here, but would not be working with supported fulltext modes (postgres, mysql) easily and searching for words with brackets seems to rather be an edge case. I'm not strictly against such escaping feature, but i won't implement it myself atm.

from search_cop.

ttekesuke avatar ttekesuke commented on September 21, 2024

OK, thank you!

from search_cop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.