charlesgodwin
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Data Access – App, Table, Form and Chart Builder plugin] Revised SearchGlad to help.
If anyone uses this, I would appreciate a note so I get some idea of usage.
Forum: Plugins
In reply to: [WP Data Access – App, Table, Form and Chart Builder plugin] Change requestsThe problem with a view is that defining a view requires different skills nd authorization. It’s not too hard to give someone without database skills rights to use and define Data Publcations. I’m trying to get myself unemployed so user can do most of their work without me. ??
Forum: Plugins
In reply to: [WP Data Access – App, Table, Form and Chart Builder plugin] Change requestsThis is probably a dumb question but JavaScript is not one of my strong languages – yet.
I did some research into Q2 and column filter
I read this page https://datatables.net/reference/api/columns().search()
And the second example is what I want to test. Of course the example uses
#example
and I need to replace it with the proper id for my published table.the table i’m publishing is named library_public. There are, in the generate WP page ids starting with library_public1. I’ve tried every iteration if #library_public1… I can think of but fail.
I’m sure I’m missing something obvious, but what?
thanks to all in advance.
Forum: Plugins
In reply to: [WP Data Access – App, Table, Form and Chart Builder plugin] Change requestsThanks Peter. Keep up the good work.
The link provided points to the custom where clause topic but does not cover “add your own search logic through a shortcode”
Second question:
Have made a decision on if or when for Q3?I am planning to experiment with your original answer for Q2 now that I have time.
My workaround for now is to create a view of just the columns I want involved in search / view.
The problem with users is they are never satisfied. ??
I’m back with more. Well, not really, as I did ask in my initial post in this topic. I asked these questions:
Does it search every field/column in the table?
Can you control/restrict the columns searched?
I have found the answer to the first and it is YES, all columns are candidates to be searched and the default is to search every string type column.
Now the other question, limiting the search to certain columns. Our site has tables with columns that are not shown in the published table for many reasons including privacy. But the current search may get a match in a column that is not displayed. This can be confusing and could be a breach of confidentiality, depending on the search.
The question is what to do about it? The new wpda_construct_where_clause filter in release 3.0 does provide the schema and table so a very customized filter could pick specific columns. But this solution has a limitation. There is only one filter but there could be many different views of the same table in either projects or publisher and each can have its own list of columns to show and it gets impossible to implement in the current filter.
A quick solution may be to add another parameter to the filter which is an array of the columns in the view. This would work for me but…..
Would it be easier if this functionality was embedded in the definition of a “view” as a field similar to Column Names (* = all) named, perhaps, Columns to search (* = all) and search for this view would search just this list of columns instead of all columns in the table.
I have no idea how complex this would be so feel free to add it to your to do list or ignore it.
Yes, like you I’ve been busy with other things. It can wait if you prefer, I’m woring around it.
Peter, it’s working. Thank you.
Once this search plugin is stable I will publish it as a GitHub repository. It’s not a lot of code.
Here’s an extract I sent to my users about my search algorythm.
You can enter multiple words or “tokens” in the search box. Separate the words with spaces. The search will examine EACH column in the database for the existence of all of the words. For example, if you type in the words john smith, it will check every column to see if it contains the value john AND the value smith. The search is case insensitive, i.e. JOHN is the same as john. The search doesn’t care about order. John smith is the same as smith john. The values can be contained in longer words. For example it will find john in Johnston and smith in Smithsonian.
If you really need to use a space as part of your search, such as le Moine, then enclose the word in double quotes. “le Moine”.
I’m using WP 5.3.2 and WPDA 2.1 and, when possible, the block editor. It is working for me with single short code on a page. It does not like two of your shortcodes on a page. But I am not relying on that at the moment.
I will be offline for a few days starting later today.
I currently don’t have an active wpdadiehard shortcode in use. I suspended work on a project front-end as I was in the middle of site migration and had a work around using old code. I intend to implement when your next release comes out.
Sorry I can’t help.
But…I had a similar error show up a week ago when I used two standard wpdataaccess short codes on the same page. I redesigned to avoid the problem.BTW I’ll be offline until Sunday
Thanks
I look forward to it.
I’ll download the beta version but alas I don’t have a test machine so I’ll wait to execute. But I’ll be ready.
But I do have two thoughts about your filter. Both are just my ideas.
1 since the naming of WordPress items is undisciplined, there is always the possibility of conflicting names from different plugins. Have you considered naming the filter wpda_construct_where_clause to distinguish it?
2 I don’t have a need for this at this time but you never know. Could you add the schema name and table name as two more parameters in case someone want to develop table specific where clauses? Or something else to identify what is being “searched”.
Thanks. I’ve prepared a filter to just seperate each space delimited token and then construct a where clause of (column like ‘%token1%’ AND column like ‘%token2%” …..) OR (column2 like ….) …
I’d like to be ready to test as soon as you publish the next release. Two questions
1 can you give an estimate time for release?
2 can you tell me the planned parameters for your apply_filters(…..)This is similar to WordPress, not identical. When this one works, I’ll get bolder
I will publish my filter when it works
Forum: Plugins
In reply to: [Accordion Blocks] Modifying Title LineWorks as hoped. thanks
Peter
I am working on a proposal for syntax for a better search.
I’ve thought a bit about how a hook / action would work and based on WordPress philosophy, I’m not sure. Perhaps a
do_filter('wpda_contruct_where_clause', FALSE, $this->wpda_list_columns->get_table_columns(), $this->search_value, $pub_ID)
and if you get FALSE back use your current routine, otherwise go with what you get.Are there more than one contruct_where_clause methods, are they all the same?