Giter VIP home page Giter VIP logo

Comments (6)

benhamill avatar benhamill commented on May 31, 2024

I've never actually messed around with changing the threshold. Can you share your code? I'd have to bone up on the docs more to re-familiarize myself...

from textacular.

jekozyra avatar jekozyra commented on May 31, 2024

The search that I was performing was:

Entity.fuzzy_search(first_name: entity.first_name, last_name: entity.last_name)

So I globally updated the threshold in PostgreSQL: "select set_limit(0.9);" but this seemed to be ignored. However, I added ActiveRecord::Base.connection.execute("SELECT set_limit(0.9);") to my script before the search, and that was honoured, so it would seem to me that something is overriding the database setting.

from textacular.

benhamill avatar benhamill commented on May 31, 2024

When you globally set it, how did you do so? The theory I'm working on is that maybe the set_limit call is on a per-connection basis or something. So, if you opened a production Rails console and did it, or use the psql command to get to your DB, it would only take effect in that connection? I don't know. I'll see if I can find something in the docs.

from textacular.

benhamill avatar benhamill commented on May 31, 2024

This Stack Overflow question seems to indicate that it's a per-connection thing. So, if you're in Rails, you could set this in an initializer... maybe? I'm not sure how to handle the fact of connection pooling. 😶

from textacular.

jekozyra avatar jekozyra commented on May 31, 2024

I've submitted a pull request to add this behaviour to the documentation to
clarify pg_trgm's behaviour.


+1 646 257 2468
+353 83 127 1895
http://jilliankozyra.com

On 11 June 2014 02:43, Ben Hamill [email protected] wrote:

This Stack Overflow question
http://stackoverflow.com/questions/14608081/set-default-limit-for-pg-trgm
seems to indicate that it's a per-connection thing. So, if you're in Rails,
you could set this in an initializer... maybe? I'm not sure how to handle
the fact of connection pooling. [image: 😶]


Reply to this email directly or view it on GitHub
#52 (comment)
.

from textacular.

benhamill avatar benhamill commented on May 31, 2024

Cool. I'll close this. Further discussion in #53, then. 😄 Thanks.

from textacular.

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.