Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't tell <em>too</em> many people this, but for you, I believe it's time to ditch CFINDEX/CFSEARCH, and start using Solr directly.</p> <p>CF's implementation is built for indexing a large block of text with some attributes, not a query. If you start using Solr directly, you can create your own schema, and have far more granular control of how your search works. Yes, it's going to take longer to implement, but you will love the results. Filtering by date is just the beginning.</p> <p>Here's a quick overview of the steps:</p> <ol> <li>Create a new index using the CFAdmin. This is the easy way to create all the files you need.</li> <li>Modify the schema. The schema is in [cfroot]/solr/multicore/[your index name]/conf/</li> <li>The top half of the schema is <em><code>&lt;types&gt;</code></em>. This defines all the datatypes you could use. The bottom half is the <em><code>&lt;fields&gt;</code></em>, and this is where you're going to be making most of your changes. It's pretty straightforward, just like a table. Create a field for each "column" you want to include. "indexed" means that you want to make that field searchable. "stored" means that you want the exact data stored, so that you can use it to display results. Because I'm using CF9's ORM, I don't store much beyond the primary key, and I use loadEntityByPK() on my results page.</li> <li>After modifying the schema, you need to restart the solr service/daemon.</li> <li>Use <a href="http://cfsolrlib.riaforge.org/" rel="nofollow">http://cfsolrlib.riaforge.org/</a> to index your data (the add method is a 'insert or modify' style method), and to perform the search.</li> <li>To do a search, check out this example. It shows how to sort and filter by date. I didn't test it, so the format of the dates might be wrong, but you'll get the idea. <a href="http://pastebin.com/eBBYkvCW" rel="nofollow">http://pastebin.com/eBBYkvCW</a></li> </ol> <p>Sorry this is answer is so general, I hope I can get you going down the right path here :) </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload