Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8831801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:23:29+00:00 2026-06-14T08:23:29+00:00

I am trying to implement a VisualSearch.js Query box that can be used to

  • 0

I am trying to implement a VisualSearch.js Query box that can be used to search the attributes of particular objects. VisualSearch.js provides Facets that can have categories but does any one know of a way that I can load a facet for the model name .e.g ‘user’) then once clicked/selected load a second sub facet with a list of attributes before then giving the user a chance to finally click on the values which will be load via a JSON call. I have searched and cannot find any reference to this sort of functionality but I may just be using the incorrect term “Sub Facet”.

Here is a JSFiddle I have been playing with. http://jsfiddle.net/Savvy84/HRuAP/13/

var visualSearch = VS.init({
    container: $('#visual_search'),
    query: '',
    callbacks: {
        search: function(query, searchCollection) {},
        facetMatches: function(callback) {
            callback([
                {
                value: 'user.email',
                label: 'users.email',
                category: 'Users'},
                 {
                value: 'job.name',
                label: 'job.name',
                category: 'Jobs'},
                 {
                value: 'job.startDate',
                label: 'job.startDate',
                category: 'Jobs'}
            ]);
        },
        valueMatches: function(facet, searchTerm, callback) {
            if (searchTerm.length > 0) {
                //pass the facet to the search and let the server deal with it.
                switch (facet) {
                case 'user.email':
                    callback([
                        {
                        label: 'john.smith@example.com'},
                           {
                        label: 'jane.doe@example.com'}
                        ]);
                        break;
                }
            }
        }
    } });

Many Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:23:31+00:00Added an answer on June 14, 2026 at 8:23 am

    After reading through the source code I can see that to create this functionality I will have to fork VisualSearch.js and edit some of its classes.

    http://documentcloud.github.com/visualsearch/docs/search_facet.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to implement a timer for my game that I'm making. I have a
Trying to implement a simple print in SL4. I have a DataGrid that I
Trying to implement a search similar to here .This searches properties based on city,locality,property
Im trying to implement a destructor for the objects of linked-list Iv created. I
I'm trying implement server code of Server-Sent Events in a generic way that any
Trying to implement search with Sunspot Gem wich is using Solr.Fulltext search works fine
Trying to implement a function that will return a list of ints the represent
Trying to implement NSCopying for the first time, and I have a question about
Trying to implement some nested loops that are spitting out good old nested html
SetFocus I'm trying implement the above Se Focus code in a Class Library that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.