Giter Site home page Giter Site logo

Comments (4)

nticaric avatar nticaric commented on June 2, 2024 1

To better understand the issue, take a look a the Tokenizer class. It will break down the IP address by dots and you'll get bunch of numbers as tokens, which is not helpful in your case. What you can do is to base64 enocode the address:

    public function toSearchableArray()
    {
        return [
            'id'   => $this->id,
            'ip'   => base64_encode($this->ip),
            'port' => $this->port
        ];
    }

And while doing a search do FluxIP::search(base64_encode('0.0.0.0'))->get()

Don't forget to reindex after changing the toSearchableArray method

from laravel-scout-tntsearch-driver.

Julien-cpsn avatar Julien-cpsn commented on June 2, 2024

I can't show any IP address because it is personnal data, sorry for the inconvenience

from laravel-scout-tntsearch-driver.

nticaric avatar nticaric commented on June 2, 2024

Another option is writing a custom tokenizer specially for IP addresses

from laravel-scout-tntsearch-driver.

Julien-cpsn avatar Julien-cpsn commented on June 2, 2024

Thanks for your reactivity !
Does work really great for a single model search :)

But now I am unfortunately getting another problem :(
The query is getting weird when there is dots in the search string (eg. IP Address obviously)

Since I'm searching on different models with the same search terms it gets kinda ridiculous

The IP Address "0.0.0.0" now finds the FluxIP that are concerned (thanks!) but it also returns some more results from other models that aren't supposed to be here but because of the dots. Any suggestion?

from laravel-scout-tntsearch-driver.

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.