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 7915649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:31:31+00:00 2026-06-03T14:31:31+00:00

I am using Solr’s JSON output for AJAX example as a basis for my

  • 0

I am using Solr’s JSON output for AJAX example as a basis for my project. However I have modified things by adding a drop-down menu in the form and added faceting to the params.

Params:

function getstandardargs() {
    var params = [
        'wt=json'
        ,'facet=true'
        ,'facet.field=brand1'
        ,'facet.field=brand2'
        ,'facet.field=brand3'
        ,'facet.field=brand4'
        ,'facet.limit=2'
        ]; 

Drop- down menu:

<form name="f1" onsubmit='xmlhttpPost("/solr/select"); return false;'>
  <p>query: <input name="query" type="text">  
  <select id="Entity">
  <option value="brand1">Universal</option>
  <option value="brand2">Paramount</option>
  <option value="brand3">Fox</option>
  <option value="brand4">Sony</option>
</select> 
  <input value="Go" type="submit"></p>

I am trying to add the drop-down value to my facet query result as such:

var rsp = eval("("+str+")");
var c=document.getElementById("Entity");
cat=c.options[c.selectedIndex].value;
var output=rsp.facet_counts.facet_fields;
html += "Entity: " + output+'.'+cat;

My facet response sends back: Entity: [object Object].Universal. How do I add the drop-down value to the response query correctly so Solr can actually return the proper facet values? 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-03T14:31:34+00:00Added an answer on June 3, 2026 at 2:31 pm

    you will undoubtedly reduce the complexity of this problem by using a library for your ajax request because:

    • you can easily do the dom manipulation required to turn them into
      select options
    • you can send the request arbitrarily with the expectation to get back an actual json object
    • you can avoid the use of eval

    And since you said your response is “Entity: [object Object].Universal”, can you try to use console.log( output ); to tell us what is returned in the object, officially? there’s a possibility that by concatenating strings with an object, you’re messing up the output object

    if it is in fact an object, you can access it iteratively like this:

    for(var x in rsp.facet_counts.facet_fields) {
        //rsp.facet_counts.facet_fields[x]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using solr search and now I am adding pagination via the
I am using Solr 3.5.0 with the example server under jetty-6.1-SNAPSHOT. I have started
Let's say I want to index my shop using Solr Lucene. I have many
Im using Solr 3.5.0, and in Schema I have enabled the LowerCaseFilterFactory in all
im a beginner in using solr. i know that you can either use ajax
I'm using Solr for search. I have documents that have an integer field popularity
Using Solr 4.0 I have the following query: (family_name:(Brown) OR maiden_name:(Brown)^0.5) AND ( source:HIGHQUALITY^3000
I am using solr with replication. I have one master that indexes data and
I am using SOLR with NUTCH I have successfully configure both and Solr is
I'm using Solr with Sunspot (ruby) and due to other constraints i have to

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.