Beispiel #1
0
 public static String[] searchContent(string prefixText, int count)
 {
     Search_gl search = new Search_gl();
     Data data = new Data();
     data.add("search", prefixText);
     Lucene_gl lucene = new Lucene_gl();
     Data list = lucene.searchLucene(data);
     return search.list(list);
 }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Data data = new Data();
            Search_gl search = new Search_gl();
            Paging_gl page = new Paging_gl();
            Profile_gl profile = new Profile_gl();
            Lucene_gl lucene = new Lucene_gl();
            Data list = null;
            data.add("search", search.searchUrlConversion(Param.getString("search")));
            data.add("page", page.getCurrentSearchPage(Param.getString("page")));
            data.add("range", Param.getString("range"));
            data.add("rate", Param.getString("rate"));

            if (data.getString("search") == "")
            {
                list = search.selectAll(data);
            }
            else
            {
                list = lucene.searchLucene(data);
            }
            int count = page.setPage(data);
            for (int i = 1; i <= count; i++)
            {
                dropDownPage.Items.Add(new ListItem(i.ToString()));
            }
            dropDownPage.SelectedValue = Param.getString("page");

            if (page.previousPage(Param.getString("page")) == true)
            {
                previous.Visible = false;
            }

            if (page.nextPage(Param.getString("page"), count) == true)
            {
                next.Visible = false;
            }
            // data.add all values in to same array, pass data array to advance search class in logical lib and split in to multiple search methods.
            if (data.getString("range") != "" && data.getString("search") != "")
            {
                int range = Convert.ToInt32(data.getString("range"));
                if (range > 0)
                {
                    data.add("address", data.getString("search"));
                    list = search.searchRadius(data);
                }
            }

            searchView.DataSource = list.Source;
            searchView.DataBind();

        }
    }
Beispiel #3
0
 public int findTotalPost(Data data)
 {
     Lucene_gl lucene = new Lucene_gl();
     Profile_gl profile = new Profile_gl();
     if (data.getString("search") == "")
     {
         return profile.selectAll(data).Count;
     }
     else
     {
         return lucene.searchLucene(data).Count;
     }
 }