Code Monkey home page Code Monkey logo

Comments (6)

stokic avatar stokic commented on June 5, 2024

from tntsearch.

somegooser avatar somegooser commented on June 5, 2024

Thanks for the reply.

I am using a simple dataset with 50000+ company names. I am only using a custom tokenizer.

from tntsearch.

stokic avatar stokic commented on June 5, 2024

from tntsearch.

somegooser avatar somegooser commented on June 5, 2024

Hi,

This is my tokenizer

`<?php

namespace Search;

use TeamTNT\TNTSearch\Support\AbstractTokenizer;
use TeamTNT\TNTSearch\Support\TokenizerInterface;

class Tokenizer extends AbstractTokenizer implements TokenizerInterface
{
static protected $pattern = '/[^\p{L}\-\p{N}]+/u';

public function tokenize($text, $stopwords = [])
{
    if ($text === null) {
        return [];
    }

    $text = mb_strtolower($text, 'UTF-8');
    $text = str_replace(['-', '_', '~'], [' ', ' ', '-'], $text);
    $text = strip_tags($text);
    $split = preg_split($this->getPattern(), $text, -1, PREG_SPLIT_NO_EMPTY);

    return array_diff($split, $stopwords);
}

}
`

My query is super simpel

$indexer->query('SELECT id,nameFROMcompanies');

from tntsearch.

ultrono avatar ultrono commented on June 5, 2024

I'm using this package with a result set of 1.5 million records. Indexing from scratch takes ~5 minutes.

from tntsearch.

somegooser avatar somegooser commented on June 5, 2024

Thats crazy...

There is something weird anyways.

Indexing 10.000 rows takes like 20 seconds on my server.
But when i index 100.000 rows with alike data (so not different form of data or length) it takes about 30 minutes.
Even updating the index is very slow instead of complete reindex.

Could it be something with the size of the index file?

from tntsearch.

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.