Implementing individual property search on the server side

Implementing individual property search on the server side

garvincasimirgarvincasimir Posts: 3Questions: 1Answers: 0

Hi Allen,

I would like to implement Individual property search in my c# datatables parser library for .net core but I am not sure what the logic should be. Here is an example for global search:
Fields: A,B,C
Search Term: findme
Query: Where A contains('findme') or B contains('findme') or C contains('findme')

  1. Would would the logic be if we had the same fields but
    Search term for A: findMeInA
    Search term for B: findMeInB
    Search term for C: findMeInC
  2. If we had both a global search and individual property search would should the expected logic be?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin
    Answer ✓
    WHERE A LIKE '%findMeInA% AND B LIKE ...
    

    is how DataTables would implement column searching for your first example.

    With a global search it would do

    WHERE (
      A LIKE '%globalSearch%' OR
      B LIKE '%globalSearch%' OR
      C LIKE '%globalSearch%'
    ) AND
    A LIKE '%findMeInA% AND
    B LIKE ...
    

    Allan

  • garvincasimirgarvincasimir Posts: 3Questions: 1Answers: 0

    Thanks Allen. Exactly what I needed.

This discussion has been closed.