How to combine Server Side Search and Full Text Search

How to combine Server Side Search and Full Text Search

itrainngitrainng Posts: 4Questions: 1Answers: 0

I am not a PHP expert. Javascript looks like Klingon to me. So bear with me. I am just a web designer trying to use datatables to present data from a MySQL table (95,000 rows)

Server Side Processing is working as expected
Live search is working as expected
I cannot get full-text search to work with Server-side processing.

Below is my Index.php

<html>
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">



<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">

</head>
<body>

Dx Id Code Formatted Code Valid For Coding Short Description Long Description
$(document).ready(function() { $('#icd10').DataTable( { "processing": true, "serverSide": true, searching: true, "ajax": "server_processing.php" } ); } );

</body>
</html>

mysql -V
mysql Ver 15.1 Distrib 10.1.40-MariaDB, for Linux (x86_64) using readline 5.1

Below is my test site
https://www.prognoso.com/mycodes/

Answers

  • itrainngitrainng Posts: 4Questions: 1Answers: 0

    Sorry, my post lost all HTML formatting. Please view page source at
    https://www.prognoso.com/mycodes/
    to see what information was truncated

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @itrainng ,

    I cannot get full-text search to work with Server-side processing.

    I just looked at your site, typed "Cholera" into the search box and the correct hits were returned. Can you give more details on how you believe it's not working, please.

    Cheers,

    Colin

  • itrainngitrainng Posts: 4Questions: 1Answers: 0

    If you search for "Cholera" you get 4 hits:

    Cholera
    Cholera due to Vibrio cholerae 01, biovar cholerae
    Cholera due to Vibrio cholerae 01, biovar eltor
    Cholera, unspecified

    In my present setup your multiple word search works as long as the words are in the exact order as in the database, so "Cholera due to" will work and produce 2 hits

    However, if you search for "Cholera Vibrio" you get nothing
    Full-text search should produce a hit if any combination of words is present in any order. In full-text search, "Cholera Vibrio" or "Vibrio Cholera" should produce 2 hits.

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @itrainng ,

    Yep, that's because smart search only functions when search on the client as it would likely be too much of a hit on the DB. There's a few threads on this, such as this and this.

    Cheers,

    Colin

  • itrainngitrainng Posts: 4Questions: 1Answers: 0

    What I see are snippets of code with no instruction on how to use them. The SSP script I am using is 451 lines long. Where do I insert the snippets?

  • jakob_devjakob_dev Posts: 2Questions: 0Answers: 0

    so recently i had a problem like this... i needed to implement a smart search on server on a Node server with a Angular 5 Frontend. What i did: when the Ajax call comes to the server i catch the search and split at every whitespace, so i have every word in search on its own. After this i create a sql statement (for Postgres) like:

    SELECT * FROM "Table"
    WHERE Concat(
    "data1",
    "data2",
    "data3") iLike '%searchWord1%'
    AND Concat(
    "data1",
    "data2",
    "data3") iLike '%searchWord2%'

    it works fine for my purposes and it comes really close to the client-side smart search, in some cases ma statements have about 3k columns but performance still is good. i use it to search a table with 200k data sets

This discussion has been closed.