Problems, need help? Have a tip or advice? Post it here.
13 posts Page 1 of 2
Hi all

I have a data bound cloanable template where "Producer" can submit there requirement and information
Like Organization, Concerned Person, requirement, last date of requirement , Mobile and email etc.

Every visitor can display all the information above without Mobile and email contact (Only Member can display full information)
Everything working perfect.

below image (screen captured) is for display everyone
image1.jpg
image1.jpg (44.61 KiB) Viewed 3848 times


Now suddenly found that if any visitor can do a search with a key word above like "entertainment". Search page will display the keyword ""entertainment" and as well as mobile
email etc.
*image removed *

Now how can I say my search do not display mobile and e-mail information.

Hope you can understand what I want to say.

Kindly guide me.

Subhamoy
Hi Subhamoy,

Yes, I can see the problem.
For now there is no way to exclude selected text fields from the search results.

Rectifying this issue has been in the TODO list for quite sometime now.
I think it is time it got fixed.

If you can wait for a couple of days, I'll make the necessary changes to the codebase.
Let me know.

Thanks.
Sure, Take your time.

Thanks
If that is a real person's contact information, you should probably remove the image from the forum now.
If you only want to preform a search on one template and have control on the fields being searched, you could create a JSON from that template
Code: Select all
[
   <cms:pages masterpage='your template.php' folder='your folder' >
      {
      "field 1":"<cms:addslashes><cms:show field 1/></cms:addslashes>",
      "field 2":"<cms:addslashes><cms:show field 2/></cms:addslashes>",
      "field 3":"<cms:addslashes><cms:show field 3/></cms:addslashes>",
      "field 4":"<cms:addslashes><cms:show field 4/></cms:addslashes>"
      }<cms:if "<cms:not k_paginated_bottom/>">,</cms:if>
     
    </cms:pages>
]


set your html like this

Code: Select all
<input type="text" name="search" id="search" placeholder="Type to search"/>
<div id="loadingDiv"><img src="<cms:show k_site_link/>images/some animated gif"/><br/></div>
<div class="list" id="update"></div>


load the javascript in your page to update the search result in the div list.

Code: Select all
$('#search').keyup(function(){
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');
$.getJSON('<cms:link 'JSON.php'/>', function(data){
var output = '<div class="list">';
// exclude some fields if you like ..
$.each(data, function(key, val){
if((val.name.search(myExp) != -1) || (val.Field 1.search(myExp) != -1) || (val.Field 2.search(myExp) != -1)) {
output +='<div class="">';
output +='<div class=""><p>' + val.Field 3 + '</p></div>';
output +='<div class=""><p> ' + val.Field 1 + '</p></div>';
output +='<div class=""><p> ' + val.Field 2 + '</p></div>';
output +='</div><hr/>';
}
});
output += '</div>';
$('#update').html(output);
});
});

$(document).ready(function() {
$.getJSON('<cms:link 'JSON.php'/>', function(data){
var output = '<div class="list">';
$.each(data, function(i, val){
if (i == 20) return false; // count of shown records when first loaded ..
output +='<div class="">';
output +='<div class=""><p>' + val.Field 3 + '</p></div>';
output +='<div class=""><p> ' + val.Field 1 + '</p></div>';
output +='<div class=""><p> ' + val.Field 2 + '</p></div>';
output +='</div><hr/>';});
output += '</div>';
$('#update').html(output);
});
});

var $loading = $('#loadingDiv').hide();
$(document)
  .ajaxStart(function () {
  timeOut = setTimeout(function () {
    $loading.show();
  }, 1000);
  })
  .ajaxStop(function () {
    clearTimeout(timeOut);
    $loading.hide();
  });



I'm no javascript expert and have no idea if this have any impact on security of the page, but for now I use this as a live search alternative as long there is no way to remove fields from the search in couch.
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
@tim , Thanks for inform and warn me.

@Tomarnst, Thanks for the script you provide... but I want to use a common couch search processor for all the template. and I have to wait a update by couch .

Thank you

Subhamoy.
Hi KK

Thanks for the couch 1.4.5

Another minor change is the addition of 'searchable' parameter to cms:editable tags - setting this to '0' will prevent the regions contents from showing up in search.


is that mean I have to code like
Code: Select all
<cms:editable name='contact' searchable='0' required='1' type='text' /> 
this?

I just seen you messages and I do the same with one template, but it still showing contact information.
the pages that already exist won't do this automatically as their data is already in the search table.


is require to delete search table data ?

Thanks
Hi, I also trouble with this

I have a databound form requirement.php
[img]
requirement.png
[/img]

after submit the information it will be display in career.php
[img]
image1.jpg
[/img]

Now what happen when I search some word with couch search processor, it will display the search result. but I click the hyperlink(title) for detail its open requirement.php (databound blank form) page. but I think It should be open with career.php , because all the content is here.

Hope you can understand what I want to mean

Thanks

Attachments

Hi Subhamoy,

is require to delete search table data ?

I had mentioned this in my PM to you - for existing pages, since their search data is already persisted in the database, you need to make some dummy changes to the regions and save the page. This way the data will be collected again but this time the 0 'searchable' parameter will cause Couch to skip the specified regions.

All new pages will, obviously, respect the searchable setting.

As for your second question, when the databound form is submitted which template does the data go into? I.e. what is the template where the cloned page gets created?
Can you please let me know?
Hi KK

I upgrade my couch on 8/07/2015 with couch 1.4.5
After that I delete the template name requirement.php as a super admin
and edit
Code: Select all
<cms:template title='requiremnt Form' clonable='1'>
    <cms:editable name='name' required='1' type='text' />
   <cms:editable name='contact' searchable='0' required='1' type='text' />
    <cms:editable name='email' required='1' validator='email' type='text' />
    <cms:editable name='address' required='1'  type='text' />
   <cms:editable name='designation' required='1'  type='text' />
  <cms:editable name='organization'   type='text' />
  <cms:editable name='requirement' required='1'  type='textarea' />
  <cms:editable name='lastdate' required='1'  type='text' />
</cms:template>


and after that I register it 5-7 time but I don't know why the contact number still display
on search result.

As for your second question, when the databound form is submitted which template does the data go into? I.e. what is the template where the cloned page gets created?
Can you please let me know?


Well, I have a databound clonable template name requirement.php and I submit only one entry 7 days ago. I used career.php for displaying list view where masterpage requirement.php

Thanks.
13 posts Page 1 of 2