Comments (4)
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.
I can't show any IP address because it is personnal data, sorry for the inconvenience
from laravel-scout-tntsearch-driver.
Another option is writing a custom tokenizer specially for IP addresses
from laravel-scout-tntsearch-driver.
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)
- i have issue in traslate package HOT 4
- I keep getting weird Exception on Heroku after 24hours HOT 2
- Search with relationship(s) HOT 1
- When search term is part of different words in the index wordlist, only first matching is returned
- Incorrect numer of indexed records
- Mapping empty collection should also use newCollection() from model
- Problem with SQlite / AWS EFS HOT 1
- on shared hosting mmap() failed: [12] Cannot allocate memory HOT 1
- Mapping resulting collection should use newCollection() from model
- [Enhancement]Replace getPdo with getReadPdo
- Laravel Scout with TntSearch doesn't return certain search terms HOT 1
- Laravel 10 HOT 9
- Search is broken whith scout.tntsearch.searchBoolean = true since version 12
- How to ignore match on articles like "a" "in" "the" "this
- How to ignore match on articles like "a" "in" "the" "this"
- I'm getting multiple warnings about Creation of Dynamic properties is deprecated HOT 3
- artisan scout:import won't index
- Model update or save dont trigger tntsearch index update HOT 1
- Error running php artisan scout:import
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-scout-tntsearch-driver.