Git Product home page Git Product logo

plugin-farcrysolr's Introduction

Plugin: FarCry SOLR

Use FarCry Solr Pro Instead The FarCry Solr Pro plugin http://jeffcoughlin.github.com/farcrysolrpro/ is now available under the Apache open source license and offers a wonderful range of search options that greatly exceed this plugin's capability. Well worth a look if you are looking for an awesome search solution and have the ability to set up a separate Solr service on your server.

FarCry Solr plugin provides configuration and management services for the ColdFusion implementation of Solr search service. FarCry Solr allows you to set up a specific collection for each content type, defining exactly which properties should be searchable. In addition, there are features to allow multiple servers in a cluster manage their own collections, replicating/synchronising the verity configurations. Sample search code is provided, although many users will want to develop their own search interfaces. The plugin also provides logging and reporting of search activity.

FarCry Verity Solr requires a minimum of FarCry v6.x to function.

Installation

5,0,x or 6,0,x Installation

Update the plugin list in your project's ./www/farcryConstructor.cfm file.

<!--- FARCRY SPECIFIC --->
<cfset THIS.locales = "en_AU,en_US" />
<cfset THIS.dsn = "fullasagoog" /> 
<cfset THIS.dbType = "mssql" /> 
<cfset THIS.dbOwner = "dbo." /> 
<cfset THIS.plugins = "farcryblog,farcrysolr,farcrydoc" /> 

Configuration

You'll find the administration screens under: ADMIN > SOLR Plugin

Solr Default Configuration

If you don't specify a collection path and lhosts you will get the following defaults:

  • default CF collection path
  • lhosts; createObject("java", "java.net.InetAddress").localhost.getHostName()

Once you have installed the FarCry Solr plugin, the collection storage path can be managed in the webtop. Under the Admin tab select the General Admin -> Configuration -> Edit Config -> Solr Search -> Storage Path.

The solr collection configuration can also be managed from the webtop. Under the Admin tab, use the drop down list (defaults to "General Admin") and select the newly added option called "Solr Search Services." If you do not see Solr Search Services, try refreshing your application scope using the Admin drop down selection called "Developer Utilities."

A new scheduled task template is installed with the FarCry Solr plugin called "Update solr Collections (farcrysolr plugin)." Add a new scheduled task and select the new template from the drop down list.

How To Use

A nice feature of Solr plugin is the ability to override what content gets indexed. This is achieved by writing a custom function within the content type that starts with contentToIndex

For example, a custom function to allow the ability to restrict content to only show published content (to allow forward publishing)

For example, within an extended ./myproject/packages/types/dmNews.cfc

<cffunction name="contentToIndex" returntype="query" description="Gets news content to index">
  <cfset qContentToIndex = application.fapi.getContentObjects(typename="dmNews",lProperties="objectid",publishDate_lte=now(),expiryDate_gt=now()) /> 
  <cfreturn qContentToIndex>
</cffunction>

You can actually add multiple functions to the same content type which will then allow you to choose the function you want when you create the verity collection. Simply prefix them with contentToIndex*

For example, contentToIndexTest and contentToIndexMyCategory.

How To Use

The contentToIndex function can be overridden in your custom type or type extension. If you just want a single custom contentToIndex function, then call it contentToIndex. This is the default value that is stored in farSolrCollection.contentToIndexFunction. If you add a single custom function using a different name (say contentToIndexTest) then your function will be ignored. The collection edit interface only lets you choose from custom contentToIndex* functions if there are more than one (see webskin/farSolrCollection/edit.cfm line 99). Adding a second custom contentToIndex function (say contentToIndexProd) will allow you to select which custom function is used when an update is done.

Your custom contentToIndex function also needs the displayname attribute to be set. It may be the same value as the name attribute. The value in the displayname attribute is used for the drop down list display (see packages/types/farSolrCollection.cfc around line 102).

plugin-farcrysolr's People

Contributors

seancoyne avatar modius avatar jorgenskogas avatar

Watchers

 avatar James Cloos avatar Trond Ulseth avatar Michael Avila avatar  avatar Armindo Maurits avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.