#!/usr/bin/perl

#use utf8;
use strict;
use CGI;

use Opals::Context;
use Opals::SolrIndex qw(
    slr_getACList
    
);
use JSON;

my $dbh = Opals::Context->dbh();
END { $dbh->disconnect(); }
my $cgi      = CGI->new;
my $input = $cgi->Vars();
my $field =$input->{'field'};
my $term  =$input->{'term'};
my @locations =$cgi->param('location');
print "Content-type: text/plain\n\n";

print to_json(slr_getACList($field,$term,\@locations),{pretty=>1});



