Cfsearch from path index not including filenames/urls

When trying to search for a filename with cfsearch from an index with type “path”, nothing is returned.

Looking through file content (i.e. from PDFs) or image EXIF data works, but the filename itself doesn’t.

Any tips on how to get this working?

Can you share the code you’re using to create the index and the code you’re using to search it so we can see if it’s either a) something missing in the way you’re creating the index (my suspicion) or b) a reproducible bug?

Also, what version of Lucee are you running, what OS, etc.

Lucee, latest Lucene extension, Ubuntu Linux, Tomcat 7.

Create collection:

	action = 'create'
	collection = 'files'
	language = 'English'
	path = expandPath( '/assets/cf/search' );

Create index:

	action = 'refresh'
	collection = 'files'
	extensions = '*.*'
	key = application.pathUploads
	status = 'structStatus'
	type = 'path'
	urlPath = application.dirUploads;


	collection = 'files'
	criteria = 'marr*'
	name = 'querySearch'
	status = 'structStatus';

There is a file called “Marrakesh.jpg” in the collection, which only shows up in the result if I set criteria = ‘*’, but not with any other criteria that should match the filename.

Thanks in advance!

All *NIX platforms are case sensitive.

Yes, but Lucene isn’t when you pass it an either all lowercased or uppercased string.

But even if I pass a case-sensitive criteria or the full case-sensitive filename the filename isn’t found :frowning:

Without getting into why case sensitivity matters on *NIX hosts.

I would check the path of where your file is being uploaded
What the permissions are on the files and directories

for Ubuntu, the usual group / user is www-data for /var/www

What are you running lucee as?

The files are found and indexed. There’s a PDF in the collection and if I search for some text in its content it shows up as a result. But if I search for the PDFs filename (or part of it) nothing is found.

When you are creating your collection, the collection needs to know you want the file name passed as part of the collection data and part of the search.

If you are using cfindex, you can use key, as part of the search result.

When adding an index from a query that would do it, but when declaring the index with type=“path”, key defines the absolute path to the directory that should be added.