A user asked this question about Verity:
I've got my verity search set up on my site and its running beautifully but there are a few folders I don't want indexed when I'm creating my verity search such as my test and includes folder. Is there anyway I can specify what folders I don't want indexed?? I've done so much searching I can't figure out how. I've read the docs on CFMX6 and CFMX7 on the tags cfcollection, cfindex, and cfsearch to see where I could specify that info but I dont see anything. Would you know a way around this??
There are a few ways you could handle this. One way - don't use the recursive nature of Verity and instead specify exactly what files you want to index. This would be easier in CFMX7 since you can now do recursive cfdirectory calls. You would get the files, and then remove the files you don't want indexed.
The other option is to let Verity index the root folder, and then follow it up with a delete operation. This assumes you only have a few files or folders to remove. Of course, on a highly trafficked site, there would be the possibility of someone being able to search, and find, the bad files in the second between each operation. I'd probably say go with the first option.
Archived Comments
Ray-
Couldn't you also code it so the output from selected paths don't display on the results page?
Sure. You could use QofQ to hide the data. That would be more useful in a case where you want to hide data based on some variable. I have a blog posting on that as well (just search for verity).
Ray you are da man son! :) I was the one who asked the question as I needed to make sure users cant search certain folders (not database) on my site: http://www.javier-julio.com/. I knew it was your second option that would work I just didn't know how because I used cfindex to do the delete but it was deleting the entire collection. But now I know why! I needed to specify the folder I wanted removed from the index in the key attribute not the urlpath! :( Did some more careful reading in the CF Docs and I figured that would do the trick and it did. Thanks a bunch Ray! I will be in touch again in the future. I plan to release my own set of forums to compete with yours. ;) Take care, and thanks.
Competition is good. :) When I heard about cfopenbb, or whatever it was called, it made me add more features to Galleon.
Ahhh forget cfopenbb, yours I have found very impressive. So impressive that now I code my apps in the same manner. You know how you create an Application variable for each object CFC?? Thats how I do my apps now I have really reaped the benefits. My apps run super fast now and files are so clean and lean. I usually don't have to scroll when viewing them in DW. Thats what I took from your forums and put into mine. I will try to offer something very different.
I will be contacting you about that hopefully in the next few weeks/months as I would like to use the colors you use on your forums in mine and name after you. Least I can do as I have learned a lot from simply digging through your Galleon Forums code.
Thanks again for the post about the Verity search. I got it working real well on my site. I know you are a PSP user yourself. Did you get GTA for it yet?? If not make sure that is a priority before anything else. ;)
Just a quick note to say that before CFMX7 (I use CF5), you can use cfdirectory recursively though a recursive call to cfmodule :-).
I have the same question, how do I exclude specific files from being indexed, but I'm using ColdFusion 8 and Verity (I know I should migrate/upgrade to ColdFusion 10 and Solr, but that is not feasible right now.) I have some files that I want excluded from the Verity search. They are not in one folder but if needed I could put them all in 1 folder. In the cfindex command I list the root directory as the key and recurse: yes. So I am searching all the files on the website. In your comment (option 1) you mention to use the recursive call, get the files, then remove the ones you don't want indexed. Does that mean I would keep the cfindex command as is, but then remove the files I don't want indexed? How would I remove those?
The second option might even be a choice, the site is not that heavily trafficked. I have about 34 files to delete. How would I follow up with a delete operation? Can you give me more detail on this?
Thanks so much!
"How would I remove those?"
cfindex has a delete action. It should be as simple as that.
Thank you, Ray! It was as simple as that! It would however be simpler if I could put all 30 file names in the same cfindex delete command in the key field. I tried separating them with commas inside and outside of the " " in the key field, but it didn't work. Are multiple files not an option or am I using the wrong syntax? If not, I'll just create 30 cfindex commands.
I'm not sure you can do it in one call. Maybe you could try passing a query - that would possible work. You would build a query by hand using queryNew.
Also - you could keep the list, loop over it, and use cfindex there.